model-writtenrun 7936 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Henry Hinze reported that PostgreSQL 13 repeatedly restarted initial logical replication for a large table although PostgreSQL 12 worked, and then established that PostgreSQL 13 RC1 also worked #1 #4.
- Tom Lane traced the regression to a missing CommandComplete message expected by libpqwalreceiver, and Alvaro Herrera proposed restoring EndReplicationCommand in the START_REPLICATION handler #5 #6.
- Alvaro supplied a TAP reproducer with the proposed fix commented out, demonstrating that enabling it removed the errors; Tom requested both an explanation for the existing tests' success and documentation of the protocol requirement #10 #11.
- Alvaro discovered that an early-exit optimization bypassed the broken streaming-completion path in small, inactive test cases, and expanded the patch to remove that optimization and simplify tablesync control flow #12.
- Petr Jelinek explained the interaction between table copying, catchup, and publisher activity, then reviewed Alvaro's separated protocol and cleanup patches and accepted the negligible performance cost of removing the optimization #13 #14 #15.
- The protocol portion of #14 landed as 4e9821b6fa, with protocol documentation and an expanded regression test, and was also backpatched to PostgreSQL 13.
- The cleanup portion of #14 landed separately as b05fe7b442, adding removal of the unused missing_ok argument and unnecessary relation locking; Alvaro confirmed that this cleanup was master-only #16.
- Alvaro's post-commit notes raised another possible bug: streamed commits appeared able to commit the tablesync worker's encompassing transaction prematurely, alongside separate concerns about worker shutdown races, subscription invalidation, code placement, and test logging #16.
- Amit Kapila initially believed streaming was disabled during tablesync, prompting Alvaro's assertion proposal, but Amit then questioned whether that assumption remained valid during catchup after COPY #17 #18 #20.
- Dilip Kumar explained how tablesync catchup could enable streaming and offered an inline change to disable it, while Amit preferred investigating and supporting streaming if the design allowed it #24 #25 #27.
- Peter Smith supplied temporary debugger instrumentation and then extended it to reproduce a tablesync crash while processing streamed transactions, disproving the assertion proposal's premise #28 #30.
- Peter favored disabling streaming for simplicity, but Amit argued for consistent behavior between workers, and Dilip developed a fix that preserves the tablesync worker's single transaction across stream stop, abort, and commit #32 #33 #35 #36 #38.
- Amit's review led Dilip to share ordinary and streamed commit handling through a helper; Amit then polished the patch and tested both the reported failure and partial streamed transactions #39 #40 #41.
- Peter successfully tested the revised streaming handlers and requested explicit stream-file cleanup before synchronization completion plus a corrected transaction comment; discussion established that process-exit cleanup already prevented a resource leak, but Amit accepted the clearer ordering #43 #46 #47 #48.
- Peter retested the final revision and verified explicit file cleanup; Amit declined a redundant comment and committed #48 unchanged as 0926e96c49, announcing completion in #51 #49 #50.
- By the last message, the protocol repair, tablesync cleanup, and streaming transaction fix had landed; the assertion and temporary diagnostic patches were superseded, while the other follow-up concerns listed in #16 had no resolution recorded in this thread #51.