model-writtenrun 5179 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Jul - Sep 2022 · 16 entries
- Hubert depesz lubaczewski reported thousands of replication-slot errors while copying many tables through ten PostgreSQL 12-to-14 subscriptions, despite configuring fifty slots for an expected thirty concurrent workers #1.
- Kyotaro Horiguchi initially attributed the excess to delayed publisher-side cleanup and recommended spare slots, while Andres Freund argued for explicit cleanup; Amit Kapila clarified that explicit replication-slot removal already existed #2 #4 #6.
- Hubert's fresh logs showed replication-origin exhaustion preceding the publisher-slot buildup, and Amit identified delayed origin removal by the apply worker as the likely cause, suggesting that the owning tablesync worker could remove its origin itself #8 #9.
- Ajin Cherian implemented tablesync-worker cleanup by resetting origin ownership before dropping it, and Hou verified that the patch eliminated the exhaustion error under an artificially delayed apply worker #10 #11.
- Hou's and Peter Smith's reviews improved the concurrency explanation, origin terminology, formatting, and commit rationale across Ajin's revisions; Peter approved the resulting version #12 #13 #15 #17 #18 #19.
- Masahiko Sawada questioned rollback semantics and committing without an active origin; Amit explained that replicated data changes were already committed, and Sawada accepted that analysis while requesting corrected cleanup comments #20 #21 #22 #24.
- Sawada then supplied a complete revised patch that separated the cleanup comments and moved origin removal before streaming shutdown, which Ajin accepted #26 #27.
- Amit and Sawada identified corresponding changes needed in subscription refresh and drop, and Ajin added SYNCDONE filtering while retaining the existing READY filtering in GetSubscriptionRelations() #28 #29 #34.
- Hubert could not test custom code in his restricted environment, and Amit and Ajin agreed to limit the fix to the development branch because increasing max_replication_slots provided a workaround #38 #39 #40.
- Amit's final review changed origin removal to missing_ok=false because concurrent subscription operations were excluded by locking, and Ajin confirmed that reasoning with debugger-driven concurrency tests #41 #42.
- Amit committed the implementation from #41 unchanged as f6c5edb8ab and announced the landing in #44.
- Following buildfarm failures reported by Tom Lane, Sawada discovered that an error after origin cleanup could roll back catalog changes without restoring in-memory replication progress, allowing a restarted tablesync worker to replay already-applied transactions #46.
- Hou proposed committing SYNCDONE before dropping the origin and restoring apply-worker cleanup as a fallback; Amit reproduced the duplicate-replay failure and accepted that approach after examining the relationship between origin progress and confirmed flush position #47 #49 #50.
- Hou supplied the corrective delta and demonstrated that it prevented duplicate-key errors under an injected failure, then reposted it with comment improvements #51 #52.
- Sawada tested the correction and requested statistics reporting and clearer transaction comments; Amit incorporated those requests, and both Hou and Sawada approved the final patch #53 #54 #55 #56.
- Amit committed #54 unchanged as 88f488319b, preserving opportunistic tablesync cleanup while restoring fallback cleanup instead of reverting the original improvement #57.
Jan 2024 · 2 entries
- In January 2024, Bowen Shi reopened the thread with PostgreSQL 16 origin and slot exhaustion following COPY errors; vignesh C could not reproduce it with the stated configuration and requested logs or a test case #58 #59.
- Hou suggested that workers exiting on errors could leave origins and slots allocated while new workers started, and Bowen agreed; the thread ends with both 2022 patches committed but error-exit cleanup and the newer failure scenario still unresolved, with no further patch attached #60 #61.