agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedFrom: Noah Misch <noah@leadboat.com>
To: Álvaro Herrera <alvherre@kurilemu.de>
Cc: Andres Freund <andres@anarazel.de>
Cc: Antonin Houska <ah@cybertec.at>
Cc: pgsql-hackers@lists.postgresql.org, Mihail Nikalayeu <mihailnikalayeu@gmail.com>
Subject: Re: Race conditions in logical decoding
Date: Thu, 10 Sep 2026 16:49:11 -0700
Message-ID: <20260910234911.58.noahmisch@microsoft.com> (raw)
In-Reply-To: <aoiRAEAAzDnXfkDN@alvherre.pgsql>
References: <202603201543.t6gxppyyk66p@alvherre.pgsql>
<aoiRAEAAzDnXfkDN@alvherre.pgsql>
On Mon, Jan 19, 2026 at 05:29:25PM +0100, Antonin Houska wrote:
> A stress test [1] for the REPACK patch [1] revealed data
> corruption. Eventually I found out that the problem is in postgres core. In
> particular, it can happen that a COMMIT record is decoded, but before the
> commit could be recorded in CLOG, a snapshot that takes the commit into
> account is created and even used. Visibility checks then work incorrectly
> until the CLOG gets updated.
On Fri, Aug 21, 2026 at 08:16:02PM +0200, Álvaro Herrera wrote:
> So, what do you think of the attached?
I see $SUBJECT lost open item status because released versions have the same
defect. However, REPACK (CONCURRENTLY) increases the importance of $SUBJECT
and other logical replication data loss causes. In v18, one can recreate the
replica or run integrity checks before a cutover. REPACK (CONCURRENTLY)
automates the chain: one command starts replication, waits for consistency,
and deletes the last known good copy.
If v19 ships without a fix for $SUBJECT, I think REPACK (CONCURRENTLY) docs
need to warn about the situation. How do you see it?
view thread (38+ messages) latest in thread
Message-ID: <20260910234911.58.noahmisch@microsoft.com>
Permalink: ../20260910234911.58.noahmisch@microsoft.com/
Also on: postgresql.org/message-id/20260910234911.58.noahmisch@microsoft.com
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: noah@leadboat.com, alvherre@kurilemu.de, andres@anarazel.de, ah@cybertec.at, mihailnikalayeu@gmail.com
Subject: Re: Race conditions in logical decoding
In-Reply-To: <20260910234911.58.noahmisch@microsoft.com>
* 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