Re: Re:Re:Re: backup server core when redo btree_xlog_insert that type is XLOG_BTREE_INSERT_POST

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: yuansong <yyuansong(at)126(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Re:Re:Re: backup server core when redo btree_xlog_insert that type is XLOG_BTREE_INSERT_POST
Date: 2024-12-01 13:33:28
Message-ID: CAH2-WznTAAbNJMCddUwxepgpicxhH6y55+zWSnOMiKOSLKY2TQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Sun, Dec 1, 2024 at 8:11 AM yuansong <yyuansong(at)126(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dave Cramer 2024-12-01 14:25:17 Re: encrypted pk8 keys work with libpg connection but not in postgres_fdw
Previous Message yuansong 2024-12-01 13:09:41 Re:Re:Re:Re: backup server core when redo btree_xlog_insert that type is XLOG_BTREE_INSERT_POST

Browse pgsql-hackers by date

  From Date Subject
Next Message yuansong 2024-12-01 15:07:16 Re:Re: Re:Re:Re: backup server core when redo btree_xlog_insert that type is XLOG_BTREE_INSERT_POST
Previous Message yuansong 2024-12-01 13:09:41 Re:Re:Re:Re: backup server core when redo btree_xlog_insert that type is XLOG_BTREE_INSERT_POST