Interesting bug. Your analysis seems correct to me.
> On 5 Mar 2026, at 22:10, Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> To be safe, this code would need to use a version of GetXLogInsertRecPtr()
> that does use XLogBytePosToEndRecPtr() instead of XLogBytePosToRecPtr().
Can't we just take Insert->CurrBytePos without XLogBytePosToEndRecPtr()?
Is there a point in alignment before the page header?
Best regards, Andrey Borodin.