model-writtenrun 3312 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ian Ilyasov reported that wal_debug with a WAL_DEBUG build broke src/test/subscription/t/029_on_error.pl on master and PostgreSQL 15 and 16, and proposed extracting the last matching LSN from the logs #1.
- Michael Paquier recommended matching the expected primary-key ERROR, DETAIL, and CONTEXT together so the extracted LSN would belong to the intended failure #2.
- Amit Kapila proposed advancing the log offset after successful replication instead #3; Hayato Kuroda supplied and successfully tested that alternative #4, and Ian confirmed it worked in his environment #5.
- Michael argued that offset advancement could remain vulnerable to intervening log output #6, while Amit disputed the race under the apply worker's design #7; Michael maintained that explicit error/context matching offered stronger guarantees #8, and Amit ultimately deferred despite concerns about matching mutable error text #9.
- Ian replaced his original last-match regexp with multiline error/context matching #10, then restored the relation and transaction qualifiers #12 after Michael identified ambiguous CONTEXT variants #11; the offset-based alternative was left out.
- Michael committed the final patch with a clearer comment and a more specific error-text match as ac8c85d04b, then explained that removing the literal ERROR prefix avoided failure with verbose error logging and confirmed backpatching through PostgreSQL 15, completing the fix #13.