Vacuum & bloatadvancedPro runbook

Preempt transaction ID wraparound

PostgreSQL's 32-bit transaction IDs must be frozen before they wrap. Monitor age(relfrozenxid) per table and per database and VACUUM FREEZE the oldest, the query that finds them and the freeze that resets age to 0 are the whole technique.

Problem

What you're actually looking at

The symptom as it shows up on a real server.

Transaction IDs are 32-bit and wrap around. To stop old rows from appearing to come from the future, PostgreSQL must 'freeze' them before the age of a table's relfrozenxid approaches the two-billion limit. If freezing falls behind, the cluster eventually forces a shutdown to protect data.

Meridian wants to get ahead of wraparound: find the tables and databases with the oldest frozen XIDs and freeze them proactively rather than waiting for the emergency autovacuum.

Simple terms

PostgreSQL stamps every row with a 32-bit transaction ID, and that counter eventually wraps back around to the start. To stop old rows from suddenly looking like they came from the future, the database must "freeze" them before their age approaches the two-billion limit. If freezing falls far enough behind, PostgreSQL will shut the database down to protect your data. The technique here is simply to watch the age per table and freeze the oldest ones early, on your schedule, not in an emergency.

ProCaptured evidence where the run produced it

Full runbook for this incident

The scenario above is free. What Pro unlocks is the fix: how to identify preempt transaction id wraparound, the exact SQL to trace it, PostgreSQL 18 output for the steps we captured, the resolution path, and how to stop it recurring.
  • The full identify checklist, the exact signals that tell you it's this incident
  • Every diagnostic query; lab output is attached only to the steps we actually captured
  • The resolution path and the pitfalls that make it worse
  • Mitigation steps to stop it recurring, plus a verify-you're-done query

Card required. Cancel before day 7 and you are not charged.

Compare plans

ShareLinkedInX

Need the full procedure?

Pro runbooks finish the incident path

Free runbooks teach the shape. Pro opens the full step transcript, edge cases, and prevention depth.

FollowSubstackLinkedInnew errors · lab notes · hiring loops