agora inbox for [email protected]  
help / color / mirror / Atom feed
From: Antonin Houska <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: Race conditions in logical decoding
Date: Thu, 29 Jan 2026 20:52:47 +0100
Message-ID: <44674.1769716367@localhost> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Álvaro Herrera <[email protected]> wrote:

> On 2026-Jan-23, Antonin Houska wrote:
> 
> > > This way you wait repeatedly for one transaction until it is marked
> > > committed; and once it does, you don't test it again.
> > 
> > Sure, that's much beter. Thanks.
> 
> Actually, I wonder if it would make sense to sleep just once after
> testing all the transactions for whether they are marked committed (not
> once per transaction); and after sleeping, we only test again those that
> were not marked committed in the previous iteration.  I think you would
> end up doing less tests overall.  Something like this

I suppose that TransactionIdDidCommit() returns false pretty rarely, so one
iteration is sufficient in almost all cases. Besides that, I preferred simpler
code because it's easier to test (It's not trivial to have debugger reach the
conditions.) However it's just my preference - no real objections to your
approach.

-- 
Antonin Houska
Web: https://www.cybertec-postgresql.com





view thread (16+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Race conditions in logical decoding
  In-Reply-To: <44674.1769716367@localhost>

* 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