Commit 023430a
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 65c384c commit 023430a
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 | |
|---|---|---|---|
| |||
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
624 | | - | |
| 624 | + | |
625 | 625 | | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | 626 | | |
631 | | - | |
| 627 | + | |
632 | 628 | | |
633 | 629 | | |
634 | 630 | | |
| |||
654 | 650 | | |
655 | 651 | | |
656 | 652 | | |
657 | | - | |
658 | | - | |
| 653 | + | |
| 654 | + | |
659 | 655 | | |
660 | 656 | | |
661 | 657 | | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
| 658 | + | |
671 | 659 | | |
672 | 660 | | |
673 | 661 | | |
674 | 662 | | |
675 | 663 | | |
| 664 | + | |
| 665 | + | |
676 | 666 | | |
| 667 | + | |
677 | 668 | | |
678 | 669 | | |
679 | | - | |
680 | | - | |
681 | 670 | | |
682 | 671 | | |
683 | 672 | | |
| |||
| 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