DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Vacuuming / Freezing

vacuum_failsafe_age

Age at which VACUUM should trigger failsafe to avoid a wraparound outage.

  • Default: 1600000000
  • Type: integer
  • Range: 0 … 2100000000
  • Applies: Session (any user)

In plain words

A last line of defence against transaction ID wraparound (PostgreSQL 14+). If a table gets this old (1.6 billion), the running VACUUM switches to emergency mode: it stops sleeping for cost limits and skips index cleanup, doing only what is needed to freeze rows and advance the table's age.

For DBAs and operators

Checked at the start and periodically during a vacuum. When triggered it logs WARNING: bypassing nonessential maintenance of table "app.public.orders" as a failsafe after 0 index scans and then:

  • ignores any cost-based delay (also for autovacuum),
  • skips index vacuuming and heap truncation,
  • stops using a ring buffer (buffer access strategy), so it can use all of shared buffers.

The effective value is never below 105% of autovacuum_freeze_max_age. Seeing the failsafe in the log means your freezing is far behind: check for a blocked xmin horizon (long transactions, prepared transactions, stale slots) and whether autovacuum is under-provisioned. Dead index entries left behind are cleaned by the next normal vacuum.

If the age keeps rising, the server warns from about 40 million XIDs before the limit (WARNING: database "app" must be vacuumed within 39985214 transactions) and stops assigning XIDs 3 million before it.

How to change it

Any user can change it for their session with SET.

See it in context

XID wraparound and freezing VACUUM

Related parameters

autovacuum_freeze_max_age vacuum_multixact_failsafe_age vacuum_cost_delay

All Vacuuming parameters