model-writtenrun 4495 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Hayato Kuroda opened this thread with a fix for transactions silently lost when subscriber-side preparation fails, resetting replication-origin state before error or shutdown abort processing and adding a regression test #1.
- Shveta Malik questioned whether table-sync workers needed the same protection, and Zhijie Hou and Amit Kapila explained that ordinary transaction application can also fail after setting the origin LSN, making protection necessary beyond two-phase commit #3 #4 #7.
- Amit proposed reusing the reset helper and considering PG_ENSURE_ERROR_CLEANUP; Hayato adopted helper reuse but explained that callbacks registered inside the apply loop violate the cleanup macro's cancellation assumptions #2 #8.
- Shveta demonstrated that shutdown interrupts processed during logging can lose a prepared transaction, confirming that the shutdown callback must remain even with error-path cleanup #9 #10.
- At Amit's suggestion, Shveta moved error cleanup into apply_error_callback(), added geterrlevel(), expanded the explanation, and tested error, fatal, and shutdown cases on development and stable branches #11 #12 #13.
- Amit polished the comments, Shveta supplied backports, and the original fix landed as b39c5272c1, matching the inspectable final submission with branch adaptation and light comment differences #14 #15 #16.
- Tom Lane later questioned whether preventing progress past failed transactions changed replication policy; Amit explained that stopping on errors was intentional and described manual conflict resolution, subscription SKIP, and explicit origin advancement as recovery options #17 #18.
- Zhijie reopened the issue after discovering that parallel apply workers lacked the shutdown callback, proposing to register it in shared worker initialization and adding a parallel-apply regression test #19.
- Chao Li approved the callback relocation and corrected wording, while Amit requested explicit verification that the regression test actually failed in a parallel worker; Zhijie incorporated both suggestions and supplied branch variants #20 #21 #22 #23.
- Amit committed the parallel-worker follow-up as 1528b0d899 from the revision described in #23 and announced it in #24; the committed test explicitly selects buffered streaming, although the unavailable final attachments prevent confirming exact equivalence.
- Alexander Lakhin subsequently reported an intermittent buildfarm timeout and supplied a sleep-based reproducer showing that the expected parallel-worker error could be missed by the test's log search #25.
- Zhijie identified the late log-offset capture as the race, moved it before the publisher transaction, and confirmed that the reproducer passed with the fix #26.
- Amit committed the test patch unchanged as 36ae59dc99 and announced his approval; Alexander's final acknowledgment leaves no outstanding work identified in the thread #27 #28.