Re: gistGetFakeLSN() can return incorrect LSNs - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: gistGetFakeLSN() can return incorrect LSNs
Date
Msg-id 080D7D73-EEC7-4C5B-9E91-5CF32FE037DF@yandex-team.ru
Whole thread Raw
In response to Re: gistGetFakeLSN() can return incorrect LSNs  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers

> On 6 Mar 2026, at 00:27, Andres Freund <andres@anarazel.de> wrote:
>
> No, that'd be a completely bogus LSN, as CurrBytePos does not include any
> space for page headers, to make the the very contended spinlock'ed section in
> ReserveXLogInsertLocation() cheaper

Thanks!
Now I see it's documented that "usable bytes position" is not XLogRecPtr at all.
And XLogBytePosToEndRecPtr() is unavoidable for newly created relations in
wal_level=minimal.

Perhaps we can even add an Assert that PageSetLSN() does not stamp LSNs from future.
Sorry for raising off-topic questions, I'll go check this myself.


Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: Nitin Jadhav
Date:
Subject: Re: Change checkpoint‑record‑missing PANIC to FATAL
Next
From: "yangyz"
Date:
Subject: Re: Add pg_stat_recovery system view