model-writtenrun 5254 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Greg Stark reported that pgstat_fetch_entry() copied shared statistics without locking and questioned whether atomic reads were sufficient in #1.
- Kyotaro Horiguchi confirmed that variable-numbered statistics lacked the shared locking used for fixed-numbered statistics and supplied #2, protecting both fetch and snapshot copies while adding a lock-mode argument to the existing helper.
- Andres Freund confirmed the bug and proposed preserving the existing exclusive-lock interface by adding a separate shared-lock helper in #3; Kyotaro implemented that change in #4.
- Bertrand Drouvot approved the patch and requested clearer LWLock comment wording in #5; Kyotaro incorporated that wording in #6, which Bertrand approved in #7.
- Andres committed #6 as cd063344fb, adding only explanatory text and whitespace, with a backpatch to PostgreSQL 15; his push confirmation in #8 closed the thread with the fix landed and no outstanding requests.