slots: replication slots
Captured on 2026-09-27 (UTC+08) on a local KingbaseES V008R006C009B0014 primary and standby, database test, using ~/kbdiag built from Go source commit 93bf65d (static linux/amd64 binary). This is lab evidence, not production validation. The WARN example was created by a fault-injection script. It pauses the standby’s WAL receiver (SIGSTOP), so after wal_sender_timeout (30 seconds here) the primary’s slot turns inactive, as it does when a standby dies. Values belong to this capture only.
Usage
No options of its own. Connection options are the same as for sessions.
Healthy
activesays whether something consumes the slot, and which process (here the walsender to the standby).retainedis the WAL this slot makes the instance keep, in 1024-based units aspg_size_prettyuses. It is measured from the current WAL position on a primary and from the replay position on a standby.xminis the oldest transaction id the slot asks the instance to keep. For this physical slot it comes from the standby’shot_standby_feedback.xmin ageis how far it lags behind the current transaction id.- A logical slot can also carry a
catalog_xmin, which holds back vacuum of the system catalogs. That column appears only when some slot has one. (The lab runswal_level=replica, so it has no logical slots.)
On a standby with no slots of its own:
An inactive slot
- Nothing consumes an inactive slot, yet it keeps WAL, and one with an
xminstops VACUUM from removing old row versions. Being inactive is the line itself, so there is no time threshold and no option. - It is a WARN, not a FAIL: the application keeps working. The harm (WAL filling the disk, table bloat, no standby keeping up) comes later.
- Right after the injection almost no WAL is retained. In a real failure it keeps growing.
- A standby restarted by repmgr also makes its slot inactive for a few seconds, and that is reported too.
- Drop the slot only when its downstream is really gone. kbdiag never drops it.
Following the verify line
The verify line says to run kbdiag status on the slot’s downstream node. That is usually a standby, though a standby can have downstreams of its own. On the paused standby:
The WAL receiver still shows streaming, because a paused process does not change its status. Run it again after 10–20 seconds, as the note says:
last_msg grew from 44 seconds to 1 minute: the receiver is stuck. status does not judge last_msg, because a quiet primary only sends a message every wal_receiver_status_interval (10 seconds by default). If the node cannot be reached at all, it is down. If inst.upstream has no receiver or is not streaming, status reports that as a WARN.
Exit codes
| Code | Meaning |
|---|---|
| 0 | OK |
| 1 | WARN: an inactive slot |
| 3 | UNKNOWN: data not collected |
| 64 | Usage error |
| 69 | Cannot connect |