| From: | Zhijie Hou <houzhijie22(at)gmail(dot)com> |
|---|---|
| To: | "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
| Cc: | "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Fix LogStandbySnapshot() race during logical decoding activation |
| Date: | 2026-11-25 02:52:22 |
| Message-ID: | dcbbc6e5-522c-4ec0-b202-372728272e88@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
On Tue, Nov24, 2026 at 12:25 PM "Hayato Kuroda (Fujitsu)" wrote:
> Hi,
>
> > Here is the V2 patch.
>
> 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.
I slightly adjusted the comments in this version to make the points clear.
--
Best Regards,
Zhijie Hou
| Attachment | Content-Type | Size |
|---|---|---|
| v3-0001-Fix-LogStandbySnapshot-race-when-enabling-logical.patch | text/plain | 8.0 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Manu | 2026-11-25 03:02:49 | Re: Make COPY format extendable: Extract COPY TO format implementations |
| Previous Message | Andreas Karlsson | 2026-11-25 02:36:29 | Small cleanup of leftover pre-1.1.0 OpenSSL code |