model-writtenrun 5176 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Dilip Kumar reproduced an assertion failure after a walreceiver timeout: the conditional shutdown call skipped resetting InstallXLogFileSegmentActive when the receiver had already stopped, and his inline reset fixed the failure #1.
- Bharath Rupireddy proposed calling XLogShutdownWalRcv() unconditionally, and Dilip accepted that approach because an already stopped receiver would simply have its flag reset #2 #3.
- Kyotaro Horiguchi instead preferred resetting the flag when entering archive recovery #5; after encountering the assertion again six months later, Bharath attached a patch following that approach and removing the shutdown wrapper #6.
- Bharath revised the patch to reset only when switching to archive, avoiding repeated lock acquisitions #8; Michael Paquier questioned the source-specific assumptions and suggested combining the set/reset helpers #9, which Bharath did while retaining the transition-based reset #10.
- Noah Misch selected the unconditional shutdown call because it guarantees WALRCV_STOPPED and simplifies reasoning about receiver states #11; Michael supported it after checking the case of a standby recovering from pg_wal without restore_command #12.
- Bharath proposed an additional early return in ShutdownWalRcv() to avoid synchronization work for an already stopped receiver #13, but Kyotaro questioned its value #14 and Noah later judged its cost trivial compared with repeatedly starting receiver processes #16.
- Noah committed the one-hunk discussion-based fix as b4f584f9d2, retaining the existing helper API and omitting both the attached refactoring and the proposed early return; he confirmed the push and left extension to older released branches contingent on evidence of additional affected receiver states #16.
- The thread ended with acknowledgments from Michael and Kyotaro after the fix landed, with no further patch revision requested #17 #18.