Runbook category
WAL & replication
Open this category when the cost centre is write-ahead log or a replica, not a single query plan. Disk filling under pg_wal, checkpoint-aligned latency spikes, replication lag that refuses a simple average, or a durability setting you inherited and never measured. WAL is cheap to ignore until it is the only thing the disk is doing.
These runbooks measure instead of guessing. Bytes of WAL generated per workload. What an abandoned or inactive replication slot pins, and how to reclaim it before the volume fills. What wal_compression actually saves, usually less than the blog posts claim. How max_wal_size and checkpoint_timeout turn a flat totals graph into periodic I/O spikes. synchronous_commit traded against commit latency. Unlogged tables that empty on crash. Replication lag as three numbers, not one. hot_standby_feedback and the bloat it quietly buys on the primary.
Vacuum & bloat is the primary-side mess feedback and long horizons leave behind. Observability is how you spot checkpoint pressure and I/O before the disk alert. High availability, what a failover costs, rejoining a demoted primary with pg_rewind, routing writes without a proxy, is a smaller group on the main runbook index rather than a category page of its own, and it answers "what happens when the primary dies" rather than "why is WAL growing." Start here for slots, lag, checkpoints, and write volume.
- Pro
Reclaim WAL held by an inactive replication slot
pg_wal keeps growing and the replica the slot was created for is long gone.
- Pro
Measure your WAL generation rate
Archiving and disk sizing need a WAL bytes-per-hour number nobody has measured.
- Pro
Flatten checkpoint I/O spikes by tuning checkpoints
Latency spikes on a regular cadence while the totals graph stays perfectly flat.
- Pro
Size WAL with max_wal_size and checkpoint_timeout
max_wal_size copied from a blog post, never checked against your own WAL rate.
- Pro
Reduce WAL volume with wal_compression
Full-page images dominate the WAL stream on an update-heavy workload.
- Pro
Right-size synchronous_commit for latency
Tiny transactions spend most of their life waiting for WAL to reach durable storage.
- Pro
Find unlogged tables before a crash empties them
A table came back empty after an unclean restart, and no backup or replica has the rows.
- Pro
Stop an abandoned slot from filling the disk
One dead consumer can fill the disk, and dropping slots by hand is not a control.
- Pro
Read replication lag as three numbers
The replica is behind, and one lag number cannot say which part is behind.
- Pro
hot_standby_feedback and the bloat it buys
Replica queries stopped dying and the primary quietly stopped reclaiming space.
- Free
Measure and fence a Patroni failover
You have never timed failover, proved the old primary is fenced, or verified client routing.
- Free
Prove point-in-time recovery from archived WAL
Backups exist, but nobody has proved a timestamp restore excludes later commits.
- Pro
Stop a logical slot on a quiet database pinning WAL
A slot nobody writes to is quietly holding the whole cluster's WAL.
- Pro
Read logical decoding lag from the spill counters
Logical replication is behind and the slot looks healthy, so nobody knows what to tune.