Re: t/035_standby_logical_decoding.pl might fail on attempt to read wrong timeline
Xuneng Zhou <xunengzhou@gmail.com>
From: Xuneng Zhou <xunengzhou@gmail.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
Alexander Lakhin <exclusion@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-06-08T14:34:27Z
Lists: pgsql-hackers
On Mon, Jun 8, 2026 at 10:22 PM Bertrand Drouvot <bertranddrouvot.pg@gmail.com> wrote: > > Hi, > > On Mon, Jun 08, 2026 at 09:00:17PM +0800, Xuneng Zhou wrote: > > I tweaked the reproducer based on the theory outlined above. The main > > changes from the original reproducer are: > > > > 1) blocks at logical-walsender-after-slot-acquire in walsender.c, > > before the decoding context is created and before the reader starts > > from restart_lsn, matching the delay set by Alexander > > > 2) Forces the first read to occur during promotion. It inserts rows > > 1..4, waits for replay, starts promotion with pg_promote(false), holds > > startup at startup-logical-decoding-status-change-end-of-recovery, > > then wakes the walsender. > > Yeah, so this existing startup-logical-decoding-status-change-end-of-recovery > injection point already exists in the code tree and is also called after > CleanupAfterArchiveRecovery() and before RECOVERY_STATE_DONE change in > StartupXLOG(). > > So this is the same window as the new injection point that was added in the new > tests in v1-0002 shared up-thread [1]. > > That said, I think I prefer the v1-0002 shared up-thread [1] approach for the > tests as: > > - the injection point name clearly describes the tested condition > - no new injection point is added in walsender.c (it pauses startup mid-promotion > and lets the walsender connect) > - the test relies on one injection point (not two) > > [1]: https://postgr.es/m/aiaBtENl7tTf2MM8%40bdtpg > Thanks for the clarification. I haven't reviewed the patch set other than applying the patch 1 yet, but I plan to do so tomorrow. -- Regards, Xuneng Zhou HighGo Software Co., Ltd.
Commits
-
Fix second race with timeline selection during promotion
- d9b49e5b4fc2 16 (unreleased) landed
- ab5334d8bfa2 17 (unreleased) landed
- 4bff3aa51c19 18 (unreleased) landed
- a8ee70bd5e00 19 (unreleased) landed
-
Remove TAP test for timeline lookup race with logical decoding on standbys
- c011d5b65457 17 (unreleased) landed
-
Fix race with timeline selection in logical decoding during promotion
- 8cd687c44b62 16 (unreleased) landed
- 16b89ff04839 17 (unreleased) landed
- b4bd1385043c 18 (unreleased) landed
- eb4e7224a1c6 19 (unreleased) landed
-
Backport GetWALInsertionTimeLineIfSet()
- 2a04624daa32 16 (unreleased) landed
-
TAP test for logical decoding on standby
- fcd77d53217b 16.0 cited