model-writtenrun 1236 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin opened the thread with a reproducer showing that an immediately stopped primary could replay unreplicated local WAL and then fail to follow a promoted standby's timeline #1.
- Aleksander Alekseev argued that refusing inconsistent timelines was expected, suggested pg_rewind, and recommended fixing flaky tests, while Alexander questioned whether recovery could prefer the new primary's WAL; the discussion produced no server-behavior change #2 #3 #4 #5.
- After a two-year gap, Alexander revived the issue with a 009_twophase buildfarm timeout, and Hayato Kuroda proposed waiting for standby replay before three shutdowns #6 #7.
- Alexander showed that replay waits still allowed a race and supplied an aggressive background-writer reproducer, establishing that RUNNING_XACTS records could appear even without concurrent application writes #8 #9 #10.
- Hayato added injection points to suppress RUNNING_XACTS records, then moved their attachment earlier and disabled autovacuum and frequent checkpoints after Alexander reported further failures and questioned other sources of WAL #11 #12 #13.
- Alexander reported that replacing teardown_node() with stop() survived his experiments, and subsequent investigation established that the injection-point proposal worked when injection points were enabled #14 #15.
- Michael Paquier requested explicit skipping and explanatory comments for unsupported builds; Hayato implemented those requirements and documented the configuration changes, despite concern about reduced test coverage #16 #17 #18 #20.
- Alexander identified a similar failure in 004_timeline_switch and observed that 012_subtransactions survived stress testing with clean shutdowns; Hayato explained that fast shutdown lets the WAL sender drain outstanding records #19 #21.
- Michael concluded that 009_twophase needed only one clean shutdown because the other two sequences already used stop(), discarded the injection-point and configuration machinery, and attached the replacement after more than fifty successful stress iterations #22 #23 #24.
- Hayato endorsed the simpler solution before Michael committed #24 unchanged as ad8c86d22c, allowing the fix to be backpatched through PostgreSQL 14 without injection-point dependencies #25.
- Alexander suggested checking other recovery tests, but Michael found no reason to alter 012_subtransactions or 028_pitr_timelines without a matching failure and explained how unequal WAL receipt by two standbys could break 004_timeline_switch; Alexander agreed to focus on demonstrated failures #26 #27 #28.
- Michael implemented the discussion's 004_timeline_switch fix in ea4744782b, replacing immediate shutdown with stop() and removing the redundant catchup wait, then confirmed backpatching through PostgreSQL 14 #29.
- The thread ended with both targeted test fixes landed and Hayato reporting no related buildfarm failures so far, while noting that configuration failures might obscure results and continued monitoring was appropriate #30.