model-writtenrun 6402 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Andres Freund reported that dropping, replacing, or advancing a replication slot could race with invalidation, and preferred checking eligibility and acquiring the slot atomically over holding the allocation lock throughout the operation #1.
- Andres Freund supplied a two-patch implementation of that approach and removal of the now-unnecessary SlotAcquireBehavior API, while questioning the timed condition-variable wait and checkpointer interrupt checks #2.
- Amit Kapila reviewed the initial fix and questioned missing sleep cancellation #3; Alvaro Herrera supplied a small corrective delta and agreed the interrupt checks and API could go #4, while Andres explained that explicit cancellation was unnecessary here and handed the work to Alvaro #5 #6.
- Alvaro Herrera consolidated the fix, corrected a lock-ownership exit path that could hang the checkpointer, replaced timed sleeping, and added a separate test that stopped a walreceiver to exercise active-slot invalidation #7; the next submission corrected Windows skipping and also changed the helper's post-sleep restart path #8.
- The code portion of #8 landed as 96540f80f8, with additional condition-variable preparation and local retry changes, and was backpatched to PostgreSQL 13 while retaining the existing API there to avoid an ABI break.
- Alvaro reported the code landing but withheld the intermittently failing test, posting its remaining version for further work #9; the separate API cleanup from #2 then landed on master as 1632ea4368, announced in #10.
- Alvaro revised the test to stop both replication processes and resume the walsender before the walreceiver, then bounded its final log-search loop #12 #13; this version landed with only whitespace changes as 09126984a2, with the signal-dependent test skipped on Windows.
- Tom Lane reported a buildfarm failure after the first test landing #14, and Alvaro announced its revert before beta2 so the instability could be investigated separately #15.
- Tom diagnosed a termination-log search that ran too early and a log-offset capture that could happen too late, recommending a retry loop, earlier offset capture, and matching the expected walsender PID and slot name #16 #17.
- Alvaro incorporated Tom's test fixes into the last attached version #13 and landed it again as 24043c27b4, confirming the changes in #18.
- Alvaro confirmed there was no known pending work, and vignesh C marked the commitfest entry committed #20 #21.
- The thread reopened when Andres identified a possible indefinite sleep introduced by the committed condition-variable preparation: slot release does not take ReplicationSlotControlLock, so the exit condition must be checked after preparing the wait #22; he clarified that preparation belongs outside the retry loop, and the thread ends without a supplied fix or recorded resolution #23.