Re: Bug in logical decoding with DDL and subtransactions - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Bug in logical decoding with DDL and subtransactions
Date
Msg-id aryZFSdaUxrONyS_@paquier.xyz
Whole thread
In response to Re: Bug in logical decoding with DDL and subtransactions  (Michael Paquier <michael@paquier.xyz>)
Responses RE: Bug in logical decoding with DDL and subtransactions
List pgsql-hackers
On Wed, Sep 30, 2026 at 12:05:09PM +0900, Michael Paquier wrote:
> On Tue, Sep 29, 2026 at 05:17:19PM -0400, Tom Lane wrote:
>> Given that the problem is expensive to reproduce, I doubt that
>> bisecting to identify this still-hypothetical commit is worth the
>> trouble; I was just curious to know if anyone already understood the
>> connection.  Now, if it turns out that Bingshuai's patch doesn't make
>> prion happy, then we'll need to dig deeper.
>
> It's not that hard to reach.  If I run three check-world builds in
> parallel to load my laptop CPU (say HEAD, v19 and v18 with a
> worktree), HEAD is able to fail rather reliably like 30%~40% of the
> time, on this test.  The problem is very easy to reach for the last
> two weeks.

There is cheap way to reproduce the issue, as of two
pg_log_standby_snapshot() in ddl.sql:
@@ -231,6 +231,7 @@ ROLLBACK TO SAVEPOINT b;
 INSERT INTO tr_sub(path) VALUES ('3-top-2-#2');
 COMMIT;

+SELECT pg_log_standby_snapshot() IS NOT NULL;
 SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts',
'1');

 -- test whether a known, but not yet logged toplevel xact, followed by a
@@ -250,6 +251,7 @@ INSERT INTO tr_sub(path) VALUES ('5-top-1-#1');
 COMMIT;


+SELECT pg_log_standby_snapshot() IS NOT NULL;
 SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts',
'1');

 -- check that DDL in aborted subtransactions handled correctly

See also the attached.  This stuff reproduces quickly the assertion
failure.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Grigorev Jurij
Date:
Subject: Re: meson: pass OpenSSL/ICU include dirs to extensions
Next
From: shihao zhong
Date:
Subject: REPACK (CONCURRENTLY): do not block the table while waiting for the final lock