RE: t/035_standby_logical_decoding.pl might fail on attempt to read wrong timeline
Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Bertrand Drouvot' <bertranddrouvot.pg@gmail.com>, Alexander Lakhin <exclusion@gmail.com>, "xunengzhou@gmail.com" <xunengzhou@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-06-08T04:25:45Z
Lists: pgsql-hackers
Attachments
- 0001-WIP-try-reproducing-the-race-condition-for-promotion.patch (application/octet-stream) patch 0001
Hi Alexander, Bertrand, Xuneng, Thanks for seeing the failure. Our team also recognized but could not find the reason. > Yeah, it looks like there is a race condition here. I think we should check if > the insertion timeline has already been set (like the walsummarizer is doing). Sorry for stupid question; I tried to reproduce the failure but could not, see attached. IIUC, the issue can happen if the walsender must read the WAL record generated after the promotion but the timeline could not be updated. However, I think logical_read_xlog_page() is called after the new WAL records are generated, i.e., am_cascading_walsender has already been false at that time. So not sure where is the race? Best regards, Hayato Kuroda FUJITSU LIMITED
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