wal: WAL volume, retention, and archiving
Check WAL LSN position, sys_wal directory size, retention blockers (slots, wal_keep_segments), and archiver health.
Inspects current WAL/replay position, sys_wal disk footprint, retention factors (replication slots, wal_keep_segments, pending .ready files), and archiver status (kbdiag wal archive). Read-only: never switches, deletes, or checkpoints WAL.
Usage
Subcommands & Options
| Command / Option | Effect |
|---|---|
kbdiag wal | Show WAL/replay LSN, sys_wal size, max_wal_size, wal_keep_segments, slots, and .ready count |
kbdiag wal archive | Show archive_mode, archive_command, archiver counts/timestamps, and .ready/.done queue |
--json | Emit structured JSON (wal.position, space.wal, slot.list, archive.ready, archive.status) |
Verdict & Reading Output
wal:OK(exit=0): All WAL probes collected cleanly; retention items with[NEXT]guide follow-up tokbdiag slotsorkbdiag wal archive.UNKNOWN(exit=3): Non-monitoring roles (kbdiag_ro) skipsys_ls_waldir()andsys_ls_archive_statusdir().
wal archive:WARN(exit=1):archive.failingwhenarchive_modeis active (primary, or standby withalways),archive_commandis non-empty, andlast_failed_timeis newer thanlast_archived_time(or never succeeded).OK(exit=0): Archiving healthy, intentionally disabled (offor standbyon).UNKNOWN(exit=3):archive.statusorarchive.readyfailed/skipped.
Example (KES V9 Primary, COLUMNS=80)
Related Commands
kbdiag slots— inspect inactive replication slots andxmin/ WAL retentionkbdiag checkpoint— checkpoint vs bgwriter vs backend buffer writeskbdiag space— filesystem free space fordata_directory,sys_wal, and tablespaces