From: Michael Paquier <michael@paquier.xyz>
To: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
Cc: Alexander Lakhin <exclusion@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Aleksander Alekseev <aleksander@timescale.com>
Subject: Re: BUG: Former primary node might stuck when started as a standby
Date: Wed, 4 Mar 2026 15:29:35 +0900
Message-ID: <aafRT3EJOS274tw1@paquier.xyz> (raw)
In-Reply-To: <aafDsb5snkfkNfdS@paquier.xyz>
References: <63e55743-669e-4300-a561-7b7ff63723b6@gmail.com>
<OS9PR01MB12149D4F1A2BC23637688CE4DF56BA@OS9PR01MB12149.jpnprd01.prod.outlook.com>
<045cab6f-4738-417e-b551-01adba44d6c3@gmail.com>
<c7284102-01fb-4704-8a80-8e65f59fa933@gmail.com>
<aaU5EiNHfyMb9Bvu@paquier.xyz>
<TYRPR01MB12156CC5A9AC774B07FA7E40BF57FA@TYRPR01MB12156.jpnprd01.prod.outlook.com>
<aaZ77VvZ4Oabp30A@paquier.xyz>
<493401a8-063f-436a-8287-a235d9e065fc@gmail.com>
<OS9PR01MB121491FE3BD5D9D7341B83537F57FA@OS9PR01MB12149.jpnprd01.prod.outlook.com>
<aafDsb5snkfkNfdS@paquier.xyz>
On Wed, Mar 04, 2026 at 02:31:29PM +0900, Michael Paquier wrote:
> As a whole, it looks like we should just switch the teardown() call to
> a stop() call in the first test with xact_009_10, backpatch it, and
> call it a day. No need for injection points and no need for GUC
> tweaks.
With a little bit more patience, I have reproduced the same failure as
Alexander using the bgwriter trick, -DWAL_DEBUG and his reproducer
script with parallel runs of the 009 recovery test. The attached
patch is also proving to work. The failure happens at the 2nd~3rd
iteration without the fix, and the tests are able to last more than 50
iterations with the fix.
As far as I can see by scanning the history of the test, this is a
copy-pasto coming from 30820982b295 where the tests were initially
introduced, where teardown_node() was copied across the test
sequences. As we want to check that a promoted standby is able to
commit the 2PC transactions issued on the primary, a plain stop() will
equally work.
I'll push this fix shortly, taking care of one instability. Nice
investigation on this one, Alexander, by the way.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../aafRT3EJOS274tw1@paquier.xyz/2-signature.asc)
download
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: michael@paquier.xyz, kuroda.hayato@fujitsu.com, exclusion@gmail.com, aleksander@timescale.com
Subject: Re: BUG: Former primary node might stuck when started as a standby
In-Reply-To: <aafRT3EJOS274tw1@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