Re: Session in aborted transaction misses effective_wal_level change - Mailing list pgsql-hackers

From Shlok Kyal
Subject Re: Session in aborted transaction misses effective_wal_level change
Date
Msg-id CANhcyEVmJ2vuS-h=o8PqaGBcv=f_TQAQVVBE3sRMnfjHmS64rg@mail.gmail.com
Whole thread
In response to Re: Session in aborted transaction misses effective_wal_level change  (Masahiko Sawada <sawada.mshk@gmail.com>)
List pgsql-hackers
On Thu, 1 Oct 2026 at 08:56, Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> Hi,
>
> On Wed, Sep 30, 2026 at 10:19 AM Sergei Patiakin
> <sergei.patiakin@enterprisedb.com> wrote:
> >
> > For an aborted transaction, there is today a gap between the
> > AtEOXact_LogicalCtl call and the XID being cleared. If an
> > effective_wal_level change occurs during that gap, the change will be
> > missed. That means the next transaction on that session will not be
> > logically decoded.
> >
> > Attaching a reproducer bash script that demonstrates the missing decoded change.
> > Attaching a fix that moves the AtEOXact_LogicalCtl call later, closing the gap.
>
> Thank you for the report. I agree it's an issue that we should fix for v19.
>
> The fix looks good to me. We need to check and update XLogLogicalInfo
> in every place where we reset the top-level transaction id.
>
> I've updated the patch with the regression tests. Please review it.

Hi Sawada-san, Sergei,

I am able to reproduce the issue on HEAD and PG19.
The patch applies on both the branches and it addresses the issue.

Just a minor comment, the patch requires a pgperltidy run. Otherwise patch LGTM.

Thanks,
Shlok Kyal



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Throwing away unnecessary spin-locks
Next
From: Andres Freund
Date:
Subject: Re: BUG #19686: Rolling back SET TABLESPACE