model-writtenrun 2290 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Shawn McCoy reported that exceptions caught inside subscriber triggers or index functions cleared the apply worker's replication origin while allowing replication to continue, causing stale origin progress and duplicate data after restart, with reproductions on PostgreSQL 16.8 and 17.4 #1.
- Masahiko Sawada proposed moving the origin reset from the error callback into start_apply()'s PG_CATCH, and Amit Kapila agreed that the previous assumption that every ERROR terminates the worker was incorrect #2 #3.
- Hayato Kuroda supplied separate HEAD and stable-branch patches, reporting successful regression and reproduction tests and explaining that geterrlevel() should be removed on HEAD but retained on stable branches for API compatibility #4.
- Vignesh confirmed the fix, and both Vignesh and Masahiko requested regression coverage; Hayato added a caught-trigger-exception test, adopted Vignesh's simpler synchronization and assertion sequence, and received Vignesh's confirmation that the updated patch worked across all three branches #5 #6 #8 #9 #10 #11.
- Masahiko requested clearer explanations and test cleanup, Shawn independently confirmed the functional-index reproduction was fixed on all three branches, and Hayato incorporated the remaining review suggestions into the final submission #12 #13 #14.
- Amit committed the final submission with slight comment edits as 0de091a4b5, moving the origin reset into the terminating error path and adding the regression test, with backports through PostgreSQL 16 #14 #15.
- The thread ended with acknowledgments from Masahiko and Michael Paquier after the push, leaving no outstanding revision requests #16 #17.