On Sun, Dec 1, 2024 at 8:11 AM yuansong <yyuans...@126.com> wrote: > the _bt_binsrch_insert function always returns low, but during the post list > search, are there cases where low and mid are unequal? > > If so, this could potentially cause an offset in the subsequent > _bt_insertonpg function. > > maybe we fix it like this ?
Why? The "if (unlikely(result == 0 && key->scantid != NULL))" block is only hit when we have an "exactly-equal" index tuple -- which means an index tuple with a posting list covering a range of heap TIDs that our scantid is covered by. There should be at most one index tuple like this on any leaf page -- otherwise the index is corrupt. The hardening that I added for the posting list split stuff was added to 13.4 and 13.5. You're running a very old point release (13.2), so you weren't running a version of the server with that hardening. -- Peter Geoghegan