repl: streaming replication and sync state
Check synchronous standby settings, downstream replication lag, and standby upstream/replay progress.
Reads sys_stat_replication, synchronous_standby_names / synchronous_commit, and standby receiver/replay views (sys_stat_wal_receiver, sys_is_wal_replay_paused()). Read-only: never modifies configuration or pauses/resumes replay; use kbdiag cluster for repmgr topology.
Lag values are descriptive only. A standby replaying no new writes on an idle primary shows rising
last replayed transactionage even with zero byte lag.
Usage
Key Options
| Option | Effect |
|---|---|
--json | Emit structured JSON (repl.sync, inst.upstream, repl.replay, repl.downstreams) |
Verdict & Reading Output
WARN(exit=1):inst.upstream: standby has no WAL receiver orlast_msg_age_sexceedswal_receiver_timeout.repl.replay_paused:sys_is_wal_replay_paused()is true on standby.repl.sync_short: activesync/quorumcandidates are fewer thansynchronous_standby_namesrequires underon/remote_write/remote_apply.
UNKNOWN(exit=3): probe error/skip, unparsablesynchronous_standby_names, or masked replication state ([REDACTED]).
Example (KES V9 Standby, COLUMNS=80)
Related Commands
kbdiag cluster— repmgr node topology, primary visibility, and failover eventskbdiag slots— inactive replication slots, WAL retention, and stalexminkbdiag wal— WAL position,sys_walsize, and archive backlog