- Notifications
You must be signed in to change notification settings - Fork4.9k
Commita7ee7c8
committed
Fix crash when a page was split during GiST index creation.
The bug was similar to the one that was fixed in commit2225168. Whenwe split page X and insert the downlink for the new page, the parent pagemight also need to be split. When that happens, the downlink offset numberwe remembered for X is no longer valid. We correctly calledgistFindCorrectParent() to re-find it, but gistFindCorrectParent() doesn'tdo anything if the LSN of the page hasn't changed, and we stopped updatingLSNs during index build in commit9155580. The buggy codepath was takenif the page was split into three or more pages, and inserting the downlinkcaused the parent page to split. To fix, explicitly mark the downlinkoffset number as invalid, to force gistFindCorrectParent() to re-find it.Fixes bug #16134 reported by Alexander Lakhin, reported again as #16162 byAndreas Kunert. Thanks to Jeff Janes, Tom Lane and Tomas Vondra fordebugging. Backpatch to v12, where we stopped WAL-logging during indexbuild.Discussion:https://www.postgresql.org/message-id/16134-0423f729671dec64%40postgresql.orgDiscussion:https://www.postgresql.org/message-id/16162-45d21b7b6c1a3105%40postgresql.org1 parent5e7bedc commita7ee7c8
1 file changed
+1
-0
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1345 | 1345 |
| |
1346 | 1346 |
| |
1347 | 1347 |
| |
| 1348 | + | |
1348 | 1349 |
| |
1349 | 1350 |
| |
1350 | 1351 |
| |
|
0 commit comments
Comments
(0)