Re: Re:Re:Re: backup server core when redo btree_xlog_insert that type is XLOG_BTREE_INSERT_POST - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Re:Re:Re: backup server core when redo btree_xlog_insert that type is XLOG_BTREE_INSERT_POST
Date
Msg-id CAH2-WznTAAbNJMCddUwxepgpicxhH6y55+zWSnOMiKOSLKY2TQ@mail.gmail.com
Whole thread Raw
In response to Re:Re:Re:Re: backup server core when redo btree_xlog_insert that type is XLOG_BTREE_INSERT_POST  (yuansong <yyuansong@126.com>)
List pgsql-hackers
On Sun, Dec 1, 2024 at 8:11 AM yuansong <yyuansong@126.com> wrote:
> the _bt_binsrch_insert function always returns low, but during the post list search, are there cases where low and
midare 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



pgsql-hackers by date:

Previous
From: yuansong
Date:
Subject: Re:Re:Re:Re: backup server core when redo btree_xlog_insert that type is XLOG_BTREE_INSERT_POST
Next
From: Peter Geoghegan
Date:
Subject: Re: Re: Re:Re:Re: backup server core when redo btree_xlog_insert that type is XLOG_BTREE_INSERT_POST