Re: gistGetFakeLSN() can return incorrect LSNs

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org, Noah Misch <noah(at)leadboat(dot)com>, Tomas Vondra <tv(at)fuzzy(dot)cz>, Peter Geoghegan <pg(at)bowt(dot)ie>
Subject: Re: gistGetFakeLSN() can return incorrect LSNs
Date: 2026-03-05 18:26:30
Message-ID: 65418A7A-9139-486A-9F67-B2F83E148E83@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-03-05 18:30:29 Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore
Previous Message Robert Haas 2026-03-05 18:17:07 Re: Consider low startup cost in add_partial_path