Re: BUG #19082: Failing assert in index scan - Mailing list pgsql-bugs

From Peter Geoghegan
Subject Re: BUG #19082: Failing assert in index scan
Date
Msg-id CAH2-Wzk_kSUi4CWuNMxSDRHcBDaj6S_s3pJn-hDvBts+JN5+SQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #19082: Failing assert in index scan  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-bugs
On Fri, Oct 10, 2025 at 2:10 PM Peter Geoghegan <pg@bowt.ie> wrote:
> Are you using wal_level = minimal, then?

Matthijs confirms (off list) that wal_level = minimal has been used.
So it looks like the assertion itself is wrong; it isn't accounting
for the possibility that the LSN from currPos is InvalidXLogRecPtr/0
due solely to the index build never needing to be logged.

I actually copied this _bt_killitems assertion from the similar code
path in GiST (the one at the top of gistkillitems). That won't cause
an assertion failure following an index build with wal_level = minimal
because the index build will still set the page LSN to GistBuildLSN.
That's not the case in nbtree -- nbtree doesn't use fake LSNs with
unlogged relations (although I think that it should, specifically to
remove special case handling of unlogged relations within
_bt_killitems).

Anyway, the fix is simple: remove the overzealous assertion. I'll take
care of that shortly.

--
Peter Geoghegan



pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: BUG #19082: Failing assert in index scan
Next
From: Nathan Bossart
Date:
Subject: Re: Date/Time parsing of ISO 8601 timestamps with commas