archive: WAL archiving
Captured on 2026-10-07 (UTC+08) on a local KingbaseES V008R006C009B0014 primary and standby, database test, using ~/kbdiag built from Go source commit 96c874f (static linux/amd64 binary). This is lab evidence, not production validation. No fault was injected. The primary’s WAL archiving was already failing in the lab (its archive_command runs sys_rman archive-push, and the last success was 21 days earlier), so the WARN below is what the lab really looks like; why it fails was not investigated for this page, because kbdiag does not read the server log. Values belong to this capture only.
Usage
No options of its own. Connection options are the same as for sessions.
Primary: archiving is failing
archive.failing(WARN) fires when the last attempt failed: the last failure is later than the last success, or there has never been a success. WAL that is not archived stays insys_waland is missing from the backups, but the business keeps running, so it is a WARN.settingsshowsarchive_mode,archive_commandandarchive_timeout. kbdiag first excludes what is switched off on purpose:archive_mode=offis never judged, andarchive_mode=onon a standby is not judged either, because a standby does not archive unless the mode isalways.archiveris the server’s archiver statistics, counted since the statistics reset time: how many succeeded and failed, and the last WAL file and how long ago for each.waitingcounts.readyfiles (WAL waiting to be archived) and.donefiles, and how long the oldest.readyhas waited. It is display only: it must not change the verdict.- The
verifyline points tokbdiag space(how bigsys_walhas grown). The reason the command fails is only in the server log (log_directory). - An empty
archive_commandis not judged: the PostgreSQL documentation says WAL then stays until a command is set, but this was not checked on KingbaseES, so the text only writes(empty).
Standby
The standby runs with archive_mode=always, so it archives too. It counts since its own start, and here it succeeds and has nothing waiting, so it is OK.
Without privileges
kbdiag_ro cannot call sys_ls_archive_statusdir, so waiting is skipped. That probe is display only and is not allowed to change the verdict. The finding itself comes from the statistics view, which this account can read.
Exit codes
| Code | Meaning |
|---|---|
| 0 | OK |
| 1 | WARN: the last archive attempt failed |
| 3 | UNKNOWN: data not collected or not visible |
| 64 | Usage error |
| 69 | Cannot connect |