]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Relax assertion in finding correct GiST parent
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 4 Apr 2025 10:49:00 +0000 (13:49 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 4 Apr 2025 10:50:00 +0000 (13:50 +0300)
commit3c0fe75c412b26433f9b58dd629e41475861c56d
tree1292617aaceb771a6a5e2af61a757eddd58e8d5c
parent7b565bad85b7c4c491fd04d316c6a1b93a3f66c4
Relax assertion in finding correct GiST parent

Commit 28d3c2ddcf 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.

Backpatch to v13-, all supported versions. The assertion was added in
commit 28d3c2ddcf in v12.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Reviewed-by: Tender Wang <tndrwang@gmail.com>
Discussion: https://www.postgresql.org/message-id/18396-03cac9beb2f7aac3@postgresql.org
src/backend/access/gist/gist.c