Re: BUG: Former primary node might stuck when started as a standby
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: 'Alexander Lakhin' <exclusion@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>, Aleksander Alekseev <aleksander@timescale.com>
Date: 2026-03-04T06:29:35Z
Lists: pgsql-hackers
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
Commits
-
Fix rare instability in recovery TAP test 004_timeline_switch
- 1346794feb77 14.23 landed
- 270e7b4ff519 15.18 landed
- 8e3c377e284a 16.14 landed
- 6fb8f424be05 17.10 landed
- 7185eddf0522 18.4 landed
- ea4744782b3f 19 (unreleased) landed
-
Fix rare instability in recovery TAP test 009_twophase
- bce98e49e8ac 14.23 landed
- be233b301e60 15.18 landed
- a7499ff5eb58 16.14 landed
- c81b10459bb8 17.10 landed
- 54e0a8fff145 18.4 landed
- ad8c86d22cbd 19 (unreleased) landed