Skip to content

Commit ba39946

Browse files
hlinnakaCommitfest Bot
authored and
Commitfest Bot
committed
Relax assertion in finding correct GiST parent
Commit 28d3c2d introduced an assertion that if the memorized downlink location in the insertion stack isn't valid, the parent's LSN should've changed too. Turns out that was too strict. In gistFindCorrectParent(), if we walk right, we update the parent's block number and clear its memorized 'downlinkoffnum'. That triggered the assertion on next call to gistFindCorrectParent(), if the parent needed to be split too. Relax the assertion, so that it's OK if downlinkOffnum is InvalidOffsetNumber. Back to v12, like commit 28d3c2d Discussion: https://www.postgresql.org/message-id/[email protected]
1 parent 2fd3e2f commit ba39946

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,8 @@ gistFindCorrectParent(Relation r, GISTInsertStack *child, bool is_build)
10531053
* concurrent activity during index build, but we might have changed the
10541054
* parent ourselves.
10551055
*/
1056-
Assert(parent->lsn != PageGetLSN(parent->page) || is_build);
1056+
Assert(child->downlinkoffnum == InvalidOffsetNumber ||
1057+
parent->lsn != PageGetLSN(parent->page) || is_build);
10571058

10581059
/*
10591060
* Scan the page to re-find the downlink. If the page was split, it might

0 commit comments

Comments
 (0)