Re: Race conditions in logical decoding

From: Rui Zhao <zhaorui126(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: Antonin Houska <ah(at)cybertec(dot)at>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Mihail Nikalayeu <mihailnikalayeu(at)gmail(dot)com>
Subject: Re: Race conditions in logical decoding
Date: 2026-09-23 17:33:31
Message-ID: CAHWVJhHZhnwDMvs7Ev6W2DhMJypLYNn7xOxTeFAJucuty9h+_w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks. Going back to my original loop with the limit changed to
running->xcnt makes sense.

On 2026-Sep-21 at 15:35 UTC, Alvaro Herrera wrote:
> I think we should just go up to running->xcnt
> only;

Yes, scanning the subxids was unnecessary. My previous explanation
addressed overflow, but waiting for the parent covers the children in
the non-overflow case too. A note on the top-level-first ordering in
RunningTransactionsData would make that dependency explicit.

> maybe we should add
> something in SnapBuildBuildSnapshot()

Agreed. The explanation of why historic snapshots need no wait for
transactions to finish belongs there. The comment in
SnapBuildInitialSnapshot() can then focus on why the conversion to a
normal MVCC snapshot needs the wait.

Regards,
Rui

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonathan S. Katz 2026-09-23 17:46:14 Re: PostgreSQL 19 Beta 4 release announcement draft
Previous Message Jacob Champion 2026-09-23 17:26:47 Re: contrib/pg_stat_tcpinfo