Skip to content

slots: replication slots and retention

List replication slots, active PIDs, retained WAL bytes, xmin/catalog_xmin blockers, and inactive slot warnings.

Reads sys_replication_slots and computes retained WAL from the current insert LSN (primary) or replay LSN (standby). Read-only: never drops or modifies replication slots.

Usage

kbdiag slots
kbdiag slots --json

Key Options

OptionEffect
--jsonEmit structured JSON (slot.list including xmin, catalog_xmin, restart_lsn, retained_wal_bytes)

Verdict & Reading Output

  • WARN (exit=1): slot.inactive when a replication slot is active = false. Output highlights retained WAL plus any xmin (vacuum horizon) or catalog_xmin (logical catalog horizon) held back, sorted with inactive horizon blockers first.
  • OK (exit=0): No inactive slots (or no slots configured).
  • UNKNOWN (exit=3): Probe failure or timeout. When slot.list succeeds, a non-NULL restart_lsn with a missing LSN diff still displays retained WAL unknown (and active = false triggers WARN).

Example (KES V9 Primary, COLUMNS=80)

slots  OK  (primary, system@local, endpoint=/tmp/.s.KINGBASE.54321,
    2026-12-03T03:37:18Z)
[SLOTS]
  1
  repmgr_slot_2  physical  active=yes (pid 97839)  retained=0 bytes
    xmin=6718  xmin_age=0  restart_lsn=10/40110000
  • kbdiag wal — see WAL directory size alongside slot and archive retention
  • kbdiag repl — check streaming replicas and standby receiver/replay status
  • kbdiag vacuum / kbdiag txn — investigate dead tuples or long-running transactions holding xmin