- Notifications
You must be signed in to change notification settings - Fork4.9k
Commite2bf629
committed
Fix two ancient bugs in GiST code to re-find a parent after page split:
First, when following a right-link, we incorrectly marked the current pageas the parent of the right sibling. In reality, the parent of the right pageis the same as the parent of the current page (or some page to the right ofit, gistFindCorrectParent() will sort that out).Secondly, when we follow a right-link, we must prepend, not append, the rightpage to our list of pages to visit. That's because we assume that once wehit a leaf page in the list, all the rest are leaf pages too, and give up.To hit these bugs, you need concurrent actions and several unlucky accidents.Another backend must split the root page, while you're in process ofsplitting a lower-level page. Furthermore, while you scan the internal nodesto re-find the parent, another backend needs to again split some more internalpages. Even then, the bugs don't necessarily manifest as user-visible errorsor index corruption.While we're at it, make the error reporting a bit better if gistFindPath()fails to re-find the parent. It used to be an assertion, but an elog() seemsmore appropriate.Backpatch to all supported branches.1 parent335a00a commite2bf629
1 file changed
+24
-9
lines changedLines changed: 24 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
674 | 674 |
| |
675 | 675 |
| |
676 | 676 |
| |
677 |
| - | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
678 | 681 |
| |
679 |
| - | |
| 682 | + | |
680 | 683 |
| |
681 | 684 |
| |
682 | 685 |
| |
683 | 686 |
| |
684 | 687 |
| |
685 | 688 |
| |
686 | 689 |
| |
687 |
| - | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
688 | 701 |
| |
689 | 702 |
| |
690 | 703 |
| |
691 |
| - | |
692 |
| - | |
693 |
| - | |
694 |
| - | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
695 | 709 |
| |
696 | 710 |
| |
697 | 711 |
| |
| |||
749 | 763 |
| |
750 | 764 |
| |
751 | 765 |
| |
752 |
| - | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
753 | 769 |
| |
754 | 770 |
| |
755 | 771 |
| |
| |||
821 | 837 |
| |
822 | 838 |
| |
823 | 839 |
| |
824 |
| - | |
825 | 840 |
| |
826 | 841 |
| |
827 | 842 |
| |
|
0 commit comments
Comments
(0)