WAL & replicationadvancedPro runbook

Stop an abandoned slot from filling the disk

An abandoned slot held 159.8 MB of WAL while the live standby's slot held 0.0 MB. Setting max_slot_wal_keep_size to 64MB moved the abandoned slot to wal_status lost and left the healthy replica untouched.

Problem

What you're actually looking at

The symptom as it shows up on a real server.

Dropping an abandoned slot fixes today's incident. It does not stop the next one, because the failure is unbounded retention: a slot with no consumer pins WAL forever and nothing in the default configuration puts a ceiling on it. max_slot_wal_keep_size is that ceiling, and it needs to be understood before it is set, because it works by sacrificing the slot.

Meridian has already lost a night to a slot left behind by a decommissioned replica. They want a bound that protects the disk without endangering the standby that is still working.

In plain English

A replication slot is PostgreSQL promising to keep log files until a particular consumer has read them. If that consumer never comes back, the promise never ends and the log files pile up until the disk is full. max_slot_wal_keep_size sets a limit on that promise: keep at most this much, and if a consumer falls further behind than that, break the promise to it rather than filling the disk. The important part is who gets sacrificed — the one that is too far behind, not the one keeping up.

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 stop an abandoned slot from filling the disk, 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; PostgreSQL 18 output is attached only to the steps we captured
  • The resolution path and the pitfalls that make it worse
  • Mitigation steps to stop it recurring, plus a verify-you're-done query

Connected

How this connects to the rest of the library

A live view of this page's real cross-references — what explains it, what fixes it, what to tune, and where to go next. Every link is an authored relationship, not a guess.

Open in the interactive map →