model-writtenrun 3383 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Korotkov reported that anti-wraparound autovacuum could freeze tables yet fail to restore transaction availability because vac_truncate_clog() tried to allocate an XID, and proposed reading nextXid instead #1.
- Alexander corrected his direct shared-memory read to use ReadNewTransactionId(), preserving the existing wraparound check without allocating an XID #2.
- Amit Kapila questioned whether lastSaneFrozenXid already provided the necessary check, and Alexander suggested removing the additional XID comparison #3 #4.
- Tom Lane rejected removing the defensive wraparound check or depending on the caller's lastSaneFrozenXid calculation, approved Alexander's revised patch for commit, and separately identified repeated reads of inplace-updated pg_database fields as a race requiring local copies #5.
- Nearly eight years later, Noah Misch reported that the earlier race had been fixed but demonstrated the analogous problem in vac_update_datfrozenxid(): concurrent relfrozenxid updates could incorrectly advance datfrozenxid beyond a table's horizon #6.
- Noah supplied a race fix, a diagnostic reproducer, and a separate cleanup adopting single reads elsewhere; he omitted volatile from the cleanup because those sites did not require the same ordering guarantee #6.
- The diagnostic test was explicitly excluded from commitment because its injection point would cease to make sense after the fix, and its warning output and exact XID values also needed cleanup #6.
- The final message submitted both production changes without a subsequent review or landing announcement in this thread #6; on April 29, the race fix landed unchanged as f65ab862e3 with backports through PostgreSQL 12, followed by the unchanged load-once cleanup as dd0183469b, leaving only the intentionally uncommitted diagnostic test.