Logical replication slot stuck

On-call incidentHard40 min

Your task

A Postgres primary's data volume creeps from 60% to 100% over two days and then refuses writes with 'No space left on device'. pg_wal/ has ballooned, but write traffic and checkpoint frequency are normal and unchanged, WAL generation rate is flat. pg_replication_slots shows one logical replication slot whose restart_lsn hasn't advanced in ~48 hours; that slot feeds a CDC/analytics consumer that silently died after a deploy two days ago. The primary can't recycle WAL past the stuck slot. Triage and mitigate.

It covers

  • Replication slot
  • Wal retention
  • Stalled consumer