model-writtenrun 5417 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Melanie Plageman reported that resetting subscription statistics left stats_reset NULL before any replication error, proposing inline changes to create statistics during retrieval and initialize the timestamp in #1; Andres Freund identified the missing statistics entry as the cause in #3, and Melanie supplied a reproducer in #4.
- Masahiko Sawada explained that retrieval-time creation could manufacture entries for nonexistent subscriptions and fail to persist the reset timestamp, then proposed creating statistics through the collector at CREATE SUBSCRIPTION time in #5, with rollback leftovers eventually cleaned by vacuum.
- Melanie withdrew her initial fix and suggested NULL counters until statistics existed in #6, but Sawada rejected that inconsistency with other statistics in #8; when Amit Kapila questioned whether any change was needed in #9, Sawada argued that subscription statistics differ practically because they otherwise appear only after errors in #10.
- After the move to shared-memory statistics, Sawada reopened the issue in July and identified a second bug: statistics deletion still depended on having a replication slot despite transactional deletion and the removal of autovacuum cleanup, as described in #11 and endorsed by Amit in #12.
- Sawada explained that transactional statistics now resolved his earlier rollback concern in #13, and Andres defended retaining transactional creation tracking in #14 and #15; Sawada then submitted separate deletion and creation patches in #17.
- Andres approved the deletion fix and requested a regression test and simpler initialization for the creation fix in #18; Sawada added tests in #19 and adopted the get-entry-then-reset sequence in #21 after Andres clarified it in #20.
- The deletion-only portion of #17 landed unchanged in both supplied candidates 596172260a and 7b64e4b3fa, with Andres announcing the push in #23; statistics creation remained separate.
- Andres requested subscription-specific test queries and a second reset proving that the timestamp advances in #22, and Sawada incorporated both changes without altering production code in #24.
- Andres raised backpatching the creation change to PostgreSQL 15 in #26, Amit considered it noncritical in #27, and Michael Paquier revived the thread in October while recommending development-branch-only application because PostgreSQL 15 had reached release-candidate stage in #28.
- Andres agreed to run CI and apply the creation fix to master in #29, then committed #24 unchanged as e0b0142959 and announced completion in #30; the thread ended with thanks and Michael crediting Sawada for reviving it in #32, leaving both fixes landed and the creation change unbackpatched.