pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alexander Lakhin <exclusion@gmail.com>
Cc: Bingshuai Li <lucian1412@outlook.com>
Cc: alvherre@kurilemu.de <alvherre@kurilemu.de>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Cc: mark.dilger@enterprisedb.com <mark.dilger@enterprisedb.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Andrey Rachitskiy <pl0h0yp1@gmail.com>
Cc: a.kozhemyakin@postgrespro.ru <a.kozhemyakin@postgrespro.ru>
Subject: Re: Bug in logical decoding with DDL and subtransactions
Date: Wed, 30 Sep 2026 14:07:33 +0900
Message-ID: <aryZFSdaUxrONyS_@paquier.xyz> (raw)
In-Reply-To: <arx8ZfY4GrgZKOnH@paquier.xyz>
References: <ME0P300MB0953FB8C1B9731C5C28EEC3EC6B82@ME0P300MB0953.AUSP300.PROD.OUTLOOK.COM>
	<aqvJDO3fYcomY4Cr@alvherre.pgsql>
	<ME0P300MB095345B41B03DF50421235D0C6B82@ME0P300MB0953.AUSP300.PROD.OUTLOOK.COM>
	<694006.1790706690@sss.pgh.pa.us>
	<c7072f7b-c370-4cab-b1f6-33479e40325a@gmail.com>
	<705013.1790716639@sss.pgh.pa.us>
	<arx8ZfY4GrgZKOnH@paquier.xyz>

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

Attachments:

ddl.diff.txt (text/plain, 872B) download diff --git a/contrib/test_decoding/sql/ddl.sql b/contrib/test_decoding/sql/ddl.sql index 8c5b150079e7..afc264312334 100644 --- a/contrib/test_decoding/sql/ddl.sql +++ b/contrib/test_decoding/sql/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
signature.asc (application/pgp-signature, 832B) download

view thread (53+ messages)  latest in thread

Message-ID: <aryZFSdaUxrONyS_@paquier.xyz>
Permalink:  ../aryZFSdaUxrONyS_@paquier.xyz/
Also on:    postgresql.org/message-id/aryZFSdaUxrONyS_@paquier.xyz

 · 

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: michael@paquier.xyz, tgl@sss.pgh.pa.us, exclusion@gmail.com, lucian1412@outlook.com, alvherre@kurilemu.de, mark.dilger@enterprisedb.com, amit.kapila16@gmail.com, sawada.mshk@gmail.com, pl0h0yp1@gmail.com, a.kozhemyakin@postgrespro.ru
  Subject: Re: Bug in logical decoding with DDL and subtransactions
  In-Reply-To: <aryZFSdaUxrONyS_@paquier.xyz>
  References: <ME0P300MB0953FB8C1B9731C5C28EEC3EC6B82@ME0P300MB0953.AUSP300.PROD.OUTLOOK.COM> <aqvJDO3fYcomY4Cr@alvherre.pgsql> <ME0P300MB095345B41B03DF50421235D0C6B82@ME0P300MB0953.AUSP300.PROD.OUTLOOK.COM> <694006.1790706690@sss.pgh.pa.us> <c7072f7b-c370-4cab-b1f6-33479e40325a@gmail.com> <705013.1790716639@sss.pgh.pa.us> <arx8ZfY4GrgZKOnH@paquier.xyz> <aryZFSdaUxrONyS_@paquier.xyz>

* 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