Transaction ID wraparound approaching
Your task
A warning escalates over a day: "database is X transactions away from wraparound; reduce the load or run vacuum." Your high-write Postgres primary is approaching transaction-ID (XID) wraparound. pg_stat_progress_vacuum shows autovacuum workers running but barely making progress; the oldest table's age(relfrozenxid) is over 1.8 billion and climbing toward the ~2.1B safety limit, after which Postgres will refuse new write transactions to protect data. Context: write volume doubled last quarter, autovacuum_max_workers is at the default 3, several huge append-mostly tables rarely get vacuumed, and autovacuum_vacuum_cost_limit is low. If you do nothing, the DB will go read-only. Triage and act.
It covers
- Autovacuum
- Transaction id wraparound