RE: Fix LogStandbySnapshot() race during logical decoding activation

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Zhijie Hou' <houzhijie22(at)gmail(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: RE: Fix LogStandbySnapshot() race during logical decoding activation
Date: 2026-11-25 05:07:49
Message-ID: OS7PR01MB183179962A78423125BE308ACF5432@OS7PR01MB18317.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> > Quick (and possibly stupid) question. Is there a reason why
> > IsXLogLogicalInfoEnabled() is done before GetRunningTransactionLocks()
> > and LogAccessExclusiveLocks()? You said to put it right before
> > GetRunningTransactionData(), but these functions are done in-between.
> > It's harmless but it's clearer for me to put them before.
> Thanks for looking at the patch.
>
> I don't see a functional difference in the order here and didn't intend
> to change the original placement, since IsLogicalDecodingEnabled() was
> already called at the beginning of LogStandbySnapshot() on HEAD, and
> none of the calls before inserting the xl_running_xacts record process
> interrupts (so this backend cannot absorb the barrier and let a
> concurrent activation complete in-between). The comment was only meant
> to remind future readers not to defer the check until ProcArrayLock is held.

Thanks for the detailed descriptions. I understood. v3 LGTM.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2026-11-25 05:13:33 Re: Proposal: Conflict log history table for Logical Replication
Previous Message Kirill Reshke 2026-11-25 05:05:42 Re: Add CHECK_FOR_INTERRUPTS() to XPath result serialisation