pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Antonin Houska <ah@cybertec.at>
To: alvherre@kurilemu.de
Cc: pgsql-hackers@lists.postgresql.org
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: <202601282119.cosfxnhvtqpo@alvherre.pgsql>
References: <202601282119.cosfxnhvtqpo@alvherre.pgsql>

Álvaro Herrera <alvherre@kurilemu.de> 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 (38+ messages)  latest in thread

Message-ID: <44674.1769716367@localhost>
Permalink:  ../44674.1769716367@localhost/
Also on:    postgresql.org/message-id/44674.1769716367@localhost

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: ah@cybertec.at, alvherre@kurilemu.de
  Subject: Re: Race conditions in logical decoding
  In-Reply-To: <44674.1769716367@localhost>
  References: <202601282119.cosfxnhvtqpo@alvherre.pgsql> <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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox