Commit 579b9f9
committed
Fix handling of all-zero pages in SP-GiST vacuum.
SP-GiST initialized an all-zeros page at vacuum, but that was not
WAL-logged, which is not safe. You might get a torn page write, when it gets
flushed to disk, and end-up with a half-initialized index page. To fix,
leave it in the all-zeros state, and add it to the FSM. It will be
initialized when reused. Also don't set the page-deleted flag when recycling
an empty page. That was also not WAL-logged, and a torn write of that would
cause the page to have an invalid checksum.
Backpatch to 9.2, where SP-GiST indexes were added.1 parent 491c24f commit 579b9f9
File tree
2 files changed
+10
-21
lines changed- src
- backend/access/spgist
- include/access
2 files changed
+10
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
621 | | - | |
| 621 | + | |
622 | 622 | | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | 623 | | |
628 | | - | |
| 624 | + | |
629 | 625 | | |
630 | 626 | | |
631 | 627 | | |
| |||
651 | 647 | | |
652 | 648 | | |
653 | 649 | | |
654 | | - | |
655 | | - | |
| 650 | + | |
| 651 | + | |
656 | 652 | | |
657 | 653 | | |
658 | 654 | | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
| 655 | + | |
668 | 656 | | |
669 | 657 | | |
670 | 658 | | |
671 | 659 | | |
672 | 660 | | |
| 661 | + | |
| 662 | + | |
673 | 663 | | |
| 664 | + | |
674 | 665 | | |
675 | 666 | | |
676 | | - | |
677 | | - | |
678 | 667 | | |
679 | 668 | | |
680 | 669 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | | - | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
0 commit comments