Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita7ee7c8

Browse files
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.org
1 parent5e7bedc commita7ee7c8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎src/backend/access/gist/gist.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,7 @@ gistfinishsplit(GISTInsertState *state, GISTInsertStack *stack,
13451345
* If the parent page was split, need to relocate the original
13461346
* parent pointer.
13471347
*/
1348+
stack->downlinkoffnum=InvalidOffsetNumber;
13481349
gistFindCorrectParent(state->r,stack);
13491350
}
13501351
/* gistinserttuples() released the lock on right->buf. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp