vacuum_failsafe_age
Fact — official short description: “Age at which VACUUM should trigger failsafe to avoid a wraparound outage.”
Identity
Lifecycle
| Fact | Value |
|---|---|
| First observed | PG14 |
| Present in | PG14–19 Beta 3 |
| Removed in | No |
| Introduction commit | 1e55e7d1755c — Add wraparound failsafe to VACUUM. |
| Commit date | 2021-04-07 |
| Discussion | thread 1 · thread 2 |
Default history
| Versions | Raw boot_val |
Unit | Human value |
|---|---|---|---|
| PG14–19 Beta 3 | 1600000000 |
— | 1600000000 |
How it works
Age at which VACUUM should trigger failsafe to avoid a wraparound outage. It can be changed at session scope, so different sessions may observe different behavior.
At the failsafe age, a running VACUUM prioritizes advancing the freeze horizon quickly: cost delays stop and optional work such as index cleanup and tail truncation is skipped. This is a last defense against wraparound outage, not a routine performance mode.
Monitor and change vacuum_failsafe_age together with autovacuum_freeze_max_age, vacuum_freeze_min_age, vacuum_freeze_table_age. Validate on the relevant server role and real workload, then use its user context to choose session change, reload, or restart; a historical boot default is not the current effective value.
Tuning advice
Advice. These are workload-specific starting points and must be validated with measurements.
| Workload | Guidance |
|---|---|
| OLTP | Calibrate vacuum_failsafe_age against the oldest XID/MXID age in every database and measured vacuum completion rate. Remove long transactions, stale slots, and blocked workers; never raise ages merely to hide a backlog. |
| OLAP | Proactively VACUUM (FREEZE) newly loaded or static partitions in batch windows and reserve I/O time for full scans. Convert age budgets using peak transaction rate, not a wall-clock guess. |
| Small nodes | Upstream defaults are usually safest. A small system still needs anti-wraparound maintenance; monitor every database, not only the application database. |
Pigsty
Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.
| Template | Effective value | Versus upstream boot | Source expression |
|---|---|---|---|
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG14–19 Beta 3 unmodified; OLAP: PG14–19 Beta 3 unmodified; CRIT: PG14–19 Beta 3 unmodified; TINY: PG14–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.
Common pitfalls
- Treating failsafe as a normal high-throughput VACUUM mode.
- Ignoring skipped index cleanup after the emergency has passed.
- Raising the age to suppress evidence of a maintenance failure.
- Changing the global value while a table storage parameter overrides it.
- Treating reltuples and cumulative change statistics as exact real-time counts.
Related parameters
autovacuum_freeze_max_age · vacuum_freeze_min_age · vacuum_freeze_table_age · autovacuum_multixact_freeze_max_age · vacuum_multixact_freeze_min_age · vacuum_multixact_freeze_table_age