model-writtenrun 7157 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that concurrent replication-slot creation and deletion could reuse dropped statistics entries, produce a “can only drop stats once” error, and subsequently fail a dshash assertion, supplying a reproducer and detailed diagnosis #1.
- Kyotaro Horiguchi reproduced the failure and proposed comparing reuse counters in shared entries and cached references; he subsequently described an alpha implementation as backpatchable because it changed no on-disk format, while raising concerns about checking the counter separately from the dropped flag #2 #3.
- Nearly a year later, Andres Freund identified missing garbage-collection notification as a simpler explanation for stale local references and favored releasing those references over extending cached-entry reinitialization; he also raised unresolved questions about pending statistics and additional cross-checks #4.
- Floris Van Nee explained that callers normally batch garbage-collection notification, supplied the missing notification in pgstat_drop_replslot(), and reported that it fixed this reproducer while leaving his separately reported problem unaffected #5.
- Michael Paquier identified another possible omission in pgstat_init_function_usage(), recommended handling the replication-slot fix independently, and supplied revised comments after successful concurrent testing; Floris approved the revision while questioning whether the function-usage error path needed the same treatment #6 #7 #8.
- Michael committed the revised patch unchanged as cd312adc56 and announced backpatching through PostgreSQL 15 after further concurrent testing; at the thread's last message, the replication-slot notification fix had landed and the additional function-usage concern remained for separate investigation #7 #9.
- Months later, 818119afcc introduced generation counters to prevent stale references from freeing reused shared statistics entries; although it credits Kyotaro Horiguchi and Michael Paquier and links this report, its matching implementation was posted in thread #47615 as #575806 and committed with light edits, superseding the earlier attribution to this thread's discussion.