model-writtenrun 4758 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane traced intermittent subscription-test delays to an apply worker waiting for a tablesync worker while holding a conflicting pg_replication_origin lock, and proposed committing before waiting while questioning the broader cleanup design in #1.
- Amit Kapila explained that relation-wide locking prevented concurrent origin drops and that cleanup by both workers addressed an earlier crash-recovery race, while suggesting per-origin locking as an optimization in #2 and #3.
- Vignesh C supplied the independent per-origin locking patch in #4; his measurements in #9 showed that combining it with Tom's transaction split produced more consistent runtimes than either change alone.
- Amit and Hou challenged redundant existence checks, and Hou proposed reusing one catalog tuple and preserving missing_ok semantics in #5, #6, and #11; Vignesh incorporated that restructuring in #14 and restored a missing relation close in #15.
- Hou reported roughly 100 runs per configuration, endorsed the locking patch, and proposed treating contention between workers dropping the same origin as separate follow-up work in #16.
- Amit supplied the final version with immediate lock release when an origin had already disappeared in #17, and committed that attachment unchanged as 3e577ff602, announcing the push in #18.
- Amit also proposed a persistent PRE_SYNCDONE state to let restarted tablesync workers finish cleanup in #17; Hou implemented that separate design in #19, removing apply-worker origin deletion and adjusting replication eligibility and subscription cleanup.
- Peter Smith supported an extra cleanup state but requested clearer names and proposed placing CLEANUP after SYNCDONE in #20; Hou objected that changing the meaning of the existing state would disrupt code and user queries in #21.
- Peter then suggested clearer before-cleanup and after-cleanup names while preserving the existing 's' code in #22, and requested updates to the tablesync.c state-machine documentation in #23; the origin-lock optimization had landed, while the cleanup-state proposal remained under review and Tom's original transaction split had no recorded landing in this thread.