model-writtenrun 3332 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jason Harvey reported that a high-volume database hit an unexpectedly early wraparound shutdown after pg_upgrade because pg_resetwal fabricated an oldestXID cutoff invisible to ordinary database-age monitoring #1, and Peter Geoghegan brought the issue to the hackers list #2.
- Noah Misch explained that VACUUM FREEZE on even a small database could recompute the cutoff and proposed preserving the source cluster's oldestXID or calculating it from database freeze ages #3.
- After encountering the problem again in 2021, Andres Freund proposed removing the guessed cutoff and exposing an explicit pg_resetwal option #4; following Justin Pryzby's related reports #5, Andres argued that copying the source cutoff was necessary because replacement constants could also produce unsafe values #6.
- Bertrand Drouvot implemented pg_resetwal -u and source-oldestXID copying in pg_upgrade #7, then added normal-XID validation for -x and -u following Andres's feedback #8; the additional suggestion to validate the distance between next and oldest XIDs remained unresolved and was not implemented.
- Bruce Momjian landed Bertrand's revised patch #8 with documentation, naming, and ordering edits as 74cf7d46a9; the supplied candidate 088dbf3bc4 represents the same change adapted to pg_resetxlog, without the stronger -x validation, and Bruce announced application back through PostgreSQL 9.6 #9.
- In July 2022, Tom Lane discovered that requiring oldestXID broke upgrades from PostgreSQL 8.4, whose control-data output lacked that field, and proposed updating the minimum supported version to 9.0 rather than restoring little-used 8.4 support #12.
- Andrew Dunstan proposed extending upgrade testing to 9.0 #13, while Peter Geoghegan argued that an explicit failure for 8.4 was preferable to the previous unsafe cutoff handling #16; Andrew and Tom also investigated a separate polymorphic-aggregate test failure, which Tom explicitly moved outside this thread's scope #17 #18.
- Daniel Gustafsson revived the outstanding compatibility correction in May 2024, choosing a 9.0 minimum for PostgreSQL 12–14 rather than adopting 9.2, and retained unreachable 8.4 support code to avoid unnecessary backbranch refactoring #19.
- Tom Lane approved Daniel's patch with one comment typo correction #20, and Daniel committed it as bcd2be0c2f and confirmed application to PostgreSQL 14 through 12, completing the submitted follow-up #21.