model-writtenrun 9105 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Masahiko Sawada reported that archive recovery could leave RECOVERYHISTORY behind because cleanup now preceded history-file creation, and proposed removing it inside writeTimeLineHistory() while preserving the recovery-operation ordering #1.
- Fujii Masao suggested moving cleanup of both RECOVERYXLOG and RECOVERYHISTORY near RemoveNonParentXlogFiles(), which Sawada implemented in the next patch #2 #3.
- Michael Paquier argued that both files should instead be removed immediately after writeTimeLineHistory() to avoid leaving them behind if intervening work failed; Fujii accepted this placement, and Sawada revised the patch accordingly #6 #7 #8.
- Michael fixed a misplaced variable declaration that prevented compilation and added recovery tests; Sawada then corrected assertions that always passed and added a second standby promotion to ensure the history-file bug was exercised #9 #10.
- Michael confirmed that the revised test reproduced the original problem and clarified its comments, which Sawada accepted #11 #12.
- Michael committed the final attachment with only test formatting and a comment adjustment as df86e52cac, announced backpatches through PostgreSQL 9.5, and the thread ended with Sawada's thanks and no outstanding work #11 #13 #14.