Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xBmXk-00000003Nif-2AhL for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Sep 2026 05:07:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xBmXj-00000000EgD-1V2g for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Sep 2026 05:07:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xBmXi-00000000Eg5-2Pfq for pgsql-hackers@lists.postgresql.org; Wed, 30 Sep 2026 05:07:47 +0000 Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xBmXf-000000022tr-1naf for pgsql-hackers@lists.postgresql.org; Wed, 30 Sep 2026 05:07:46 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id C2B81EC033C; Wed, 30 Sep 2026 01:07:40 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Wed, 30 Sep 2026 01:07:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1790744860; x=1790831260; bh=M6C8QX0ulx U1YWxmTDon62tnf57YM+RUxUDN+2LkFkM=; b=0GcmBsfHrhAD6c8+Sy3MYDe5x4 EHQp9QrlRPVBptXqCPFM5oQwExkKXeinG+8XfFYJ0tn+iL0VfsvlZi1BIt1PVjxv 1lTsRsIg4Bj8qg0aNzWYVqqnLohyIh4zeVX554bWtpVUwCek3pjQ3L/OAPcuB6HA cQeea6O6EGiZ6jRl1Lt3v764KIUw37SCXXDqfoXtQ2cnPZdYsj+BHSX9ticZclAF 0aZoWgL8tFpLKJIljIUEkvaG9LGHSCQmPgQOI0K3COl4tPAJncgLpcDJlGLthDGI H+g7By5dtUbVTa2LICxkPmOk3Xt9vsEF+tkr/o669164yGS0Auju9JyhkJzw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1790744860; x=1790831260; bh=M6C8QX0ulxU1YWxmTDon62tnf57YM+RUxUD N+2LkFkM=; b=O4EgaMRQt4FoRtkYC+x5s0p5vCaOooguq7NkrSYas97HOcYqDGa fREUnK9re9YENTRhvr0BU/PToIDxLQ0TK0+626NdPjOFq2b9kyeN1oI1X6DgNPsv Ac3/1LjD6QIcLDOzXtuyZBBY3TmncBAuD57Xdiz3Lp1XC8623DSHaGflIy1Ew6rO udCt/dQ2OD4IsyfTju+CJjj9vqFVxFEwkzW/D0/uv18w50suMkfeHvKP0SGADWMk b77qM2V9JLUWMjKqW8JmkGpQ3zsYfPcHzEQCuvBtxUBj7g38duk8BizfXV9c6V3v 27EXfeSU7rdSkXGSvwR4Yanc4Pbo4AvWaFQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGFch7FHxkTaxpGeS3YdGvwvGtgarGpeQ/v8dFmMWgrOHgQor+3l7uduhKBb5m4L/ IMpPisW8zMH9yIg1zDP9IazNdnaWPXWiHdRvPo6DsvmW8hwr2gJ9GrvxrF++OOiUZ/oKL+ f2FvgMnhw2juHgKN693ZkrTWRc8Rh9P4dGSrm1HUQd8p38gBk4A3lv6V8yoCgJ0SLoxQi6 exhemXFltizYGlLQi0egEIvZ+rGnVZ4/OFxP0kHlXByhCzcelwTuHrf6sttyd0L5yqwSAw ph5zEvQCx8VwAuxHJ+yoKL/cWT+VhqW2SSUJdyyBTeVtZ74k8nsv+A6xKr7zNWL5uXK5ke kogtrUwd1igr0JCtRKG7mH1StPfBAmO6/y2AtEEYHZAZmLAXb/Bav4raCgQrDMEZIRGKW8 MS8kLNFl5OxRKUDagAEKHQUdymRRb4Ei1KuIBXJ0Cq8537gZf/GmqJi9NYaK9x8xd7c2D+ +NQe6FtOjAFwQoamcVqkKs+fDZnabPuQnkx+2oXfl51rLmqhQ6bka8la8EnJ9unrrwYZhy 9wXh1zi23zxAoOiV6AXp0GeyVhYg+EEi3Cs/WBiIHSi2MjWXketKYagrO9qy3tzeFST4a/ xOBlLJbl67NY0/9sTjHLvGNPAKlhPFUr4/6Rocv/sXpShT6iCGEml/YQ4n3A X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 30 Sep 2026 01:07:37 -0400 (EDT) Date: Wed, 30 Sep 2026 14:07:33 +0900 From: Michael Paquier To: Tom Lane Cc: Alexander Lakhin , Bingshuai Li , "alvherre@kurilemu.de" , "pgsql-hackers@lists.postgresql.org" , "mark.dilger@enterprisedb.com" , Amit Kapila , Masahiko Sawada , Andrey Rachitskiy , "a.kozhemyakin@postgrespro.ru" Subject: Re: Bug in logical decoding with DDL and subtransactions Message-ID: References: <694006.1790706690@sss.pgh.pa.us> <705013.1790716639@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EWSuLpJ+5k+gIrEC" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --EWSuLpJ+5k+gIrEC Content-Type: multipart/mixed; boundary="JNjrpK2na6Y9yEz7" Content-Disposition: inline --JNjrpK2na6Y9yEz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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; =20 +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'); =20 -- 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; =20 =20 +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'); =20 -- check that DDL in aborted subtransactions handled correctly See also the attached. This stuff reproduces quickly the assertion failure. -- Michael --JNjrpK2na6Y9yEz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=ddl.diff.txt Content-Transfer-Encoding: quoted-printable 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; =20 +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'); =20 -- 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; =20 =20 +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'); =20 -- check that DDL in aborted subtransactions handled correctly --JNjrpK2na6Y9yEz7-- --EWSuLpJ+5k+gIrEC Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmq8mRUACgkQnvQgOdby QH1O/hAAmyzQXVsOHhRiF7k69pc1HvDt055Puvyz4Vhov3tAxM0cg//Y0YFr1GXw 4VyPoRnWU+ozBMQa12UIC8csXW3H7I5c7K5ZBhpED+S/6DOxQwKQwcBhQMp/n6Sd khdamgvnDB1QjQvQLTkbadloAJI4sxQWfqA/GyqQzWshq6HQcghUe6p+7AiBrexT ZVjjbVZb1nFmruUTHHPbN6V12dKk0WlZgFicn5XWEoCANf52svgzJyCtYs+XtPTf jtIop09+yCiY1BqJ0+5Xrkpqe/9cptv+oGKCQCAPf0Ey6jzY/Cgx5sEz4RzxBHhh 3qFZFoGje/FGTCnyQ7QsSwnyt1nDIM+9hLJR7gSdinS22RVhwzt2mKkcu75VJruI kHB35wlqDQeMJ0967HjCBtmWMXA+bcd8IeQ6JuIxf0lTP5m0MF1oreYhqXnBBtIG FC+S9LtsW4rvJfVICDHLsNdaZI6hPC4oSf/WHsABkdpMid24pbQW4oVD9D9iRm1k J+cJb/umAFChXqJkwSvEPukbnvViW/aoXMLICNCG3ZPg28tjAoVYisGQyl9IxiRt N7EODTmm8088ytzof22Fp5kpE1WeW3PoPNIE1rrTLQiZ1BwTulfISbSiUDkpaKOh WYnNV6l2Xr6G0ifX8JUVdJKHdJY06JN1vAwfqOCtT1VCn6S/LIw= =PH01 -----END PGP SIGNATURE----- --EWSuLpJ+5k+gIrEC--