agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@kurilemu.de>
To: Rui Zhao <zhaorui126@gmail.com>
Cc: Antonin Houska <ah@cybertec.at>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org, Mihail Nikalayeu <mihailnikalayeu@gmail.com>
Subject: Re: Race conditions in logical decoding
Date: Thu, 24 Sep 2026 12:23:27 +0200
Message-ID: <arT5HxECyy5DYb0P@alvherre.pgsql> (raw)
In-Reply-To: <CAHWVJhHZhnwDMvs7Ev6W2DhMJypLYNn7xOxTeFAJucuty9h+_w@mail.gmail.com>

On 2026-Sep-24, Rui Zhao wrote:

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

OK, I have pushed this to all branches, including the test cases on
branches where they work.  Thanks all for the work on this issue!

I'm going to mark the two pg19 open items (!!) as done.

> 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.

I didn't add this ... let's consider that as follow-on work, but we
don't need it to be backpatched.

> > 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.

Done that way -- I hope the explanations are clear.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/






view thread (38+ messages)

Message-ID: <arT5HxECyy5DYb0P@alvherre.pgsql>
Permalink:  ../arT5HxECyy5DYb0P@alvherre.pgsql/
Also on:    postgresql.org/message-id/arT5HxECyy5DYb0P@alvherre.pgsql

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@kurilemu.de, zhaorui126@gmail.com, ah@cybertec.at, andres@anarazel.de, mihailnikalayeu@gmail.com
  Subject: Re: Race conditions in logical decoding
  In-Reply-To: <arT5HxECyy5DYb0P@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox