Re: Session in aborted transaction misses effective_wal_level change

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Sergei Patiakin <sergei(dot)patiakin(at)enterprisedb(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "msawada(at)postgresql(dot)org" <msawada(at)postgresql(dot)org>
Subject: Re: Session in aborted transaction misses effective_wal_level change
Date: 2026-10-04 07:44:22
Message-ID: asID1sONEZcDbyUX@bdtpg
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Sawada-san,

On Fri, Oct 02, 2026 at 01:54:04PM -0700, Masahiko Sawada wrote:
> On Wed, Sep 30, 2026 at 11:28 PM Hayato Kuroda (Fujitsu)
> <kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
> >
> > Dear Sawada-san, Serigei,
> >
> > Good catch, I have also been seeing and considering the test, but Sawada-san is faster.
> >
> > > 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.
> >
> > Confirmed the test fails on HEAD and pass after the patch.
> > There might be idea to put the function after the "nParallelCurrentXids = 0;"
> > even in the CommitTransaction() and PrepareTransaction(), which is same as
> > CleanupTransaction(). But any places are OK for me.
> >
> > LGTM.
>
> Thank you for reviewing the patch.
>
> I'd rather move AtEOXact_LogicalCtl() to before resetting
> CurrentResourceOwner. I think it should work fine too and caon deal
> with your concern.

I wonder if it wouldn't make more sense to keep this after XactTopFullTransactionId
is reset, as in v1?

Indeed, couldn't a barrier be processed during AtCleanup_Memory(), while the
XID is still valid, and set XLogLogicalInfoUpdatePending again after this call?

Unless I'm missing something, I don't see AtEOXact_LogicalCtl() itself relying
on CurrentResourceOwner. Is there some other reason why it needs to be called
before CurrentResourceOwner is reset?

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message JoongHyuk Shin 2026-10-04 07:54:29 Re: pg_dump: fix NOT NULL constraint name comparison using makeObjectName
Previous Message Richard Guo 2026-10-04 07:23:04 Re: ERROR: no relation entry for relid 3