Re: Race conditions in logical decoding

From: Andres Freund <andres(at)anarazel(dot)de>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Race conditions in logical decoding
Date: 2026-01-20 17:50:13
Message-ID: 5k2dfckyp6zv2fiovosvtbya5onvplgviz5n4kdamxupff4vi2@yytzfnwr2ox7
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2026-01-20 09:30:33 +0100, Antonin Houska wrote:
> Antonin Houska <ah(at)cybertec(dot)at> wrote:
>
> > I'm not sure yet how to fix the problem. I tried to call XactLockTableWait()
> > from SnapBuildAddCommittedTxn() (like it happens in SnapBuildWaitSnapshot()),
> > but it made at least one regression test (subscription/t/010_truncate.pl)
> > stuck - probably a deadlock. I can spend more time on it, but maybe someone
> > can come up with a good idea sooner than me.
>
> Attached here is what I consider a possible fix - simply wait for the CLOG
> update before building a new snapshot.

I don't think that's enough - during non-timetravel visibility semantics, you
can only look at the clog if the transaction isn't marked as in-progress in
the procarray. ISTM that we need to do that here too?

Greetings,

Andres

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2026-01-20 18:02:16 Re: Custom oauth validator options
Previous Message Andres Freund 2026-01-20 17:46:19 Re: Speed up transaction completion faster after many relations are accessed in a transaction