Skip to content

freeze: XID and multixact wraparound age

Compare instance-wide database XID/MXID ages against freeze limits and list the oldest relations in the current database.

Inspects database-wide datfrozenxid / datminmxid ages across the cluster and relation relfrozenxid / relminmxid ages in the current database. Read-only: never runs VACUUM FREEZE.

Usage

kbdiag freeze
kbdiag freeze --schema app --limit 20
kbdiag -d otherdb freeze
kbdiag freeze --json

Key Options

OptionEffect
--schema nameFilter table listing to specific schema(s); database-level freeze stays instance-wide
--all-schemasShow all schemas in the current database (same as default table coverage; conflicts with --schema)
--limit NShow at most N oldest relations (default 20, 0 for unlimited; DB judgment covers all DBs)
--jsonEmit structured JSON (freeze.limits, freeze.databases, freeze.tables)

Verdict & Reading Output

  • FAIL (exit=2): On 32-bit XID kernels (e.g. KES V8), database XID/MXID age reached the hard stop limit (2146483647 / 2147483547). Writes fail and single-user maintenance may be required.
  • WARN (exit=1): Database age exceeded autovacuum_freeze_max_age or autovacuum_multixact_freeze_max_age; anti-wraparound autovacuum is due or blocked.
  • UNKNOWN (exit=3): Limits, databases, or tables probes incomplete/failed (freeze.limits, freeze.databases, or freeze.tables).
  • 64-bit XID note: On KES V9 64-bit XID servers, kbdiag detects xid width cleanly and skips the PG12 32-bit stop limit (xid stop limit: 64-bit xid).

Example (KES V9 Primary, excerpt, COLUMNS=80)

freeze  OK  (KingbaseES V009R002C016, primary, system@local,
    endpoint=/tmp/.s.KINGBASE.54321, db=test, 2026-12-02T15:56:43Z)
[SCOPE]
  schemas=all (current database; db-level freeze is instance-wide)
[LIMITS]
  autovacuum_freeze_max_age            10000000000
  autovacuum_multixact_freeze_max_age  20000000000
  xid stop limit                       64-bit xid (32-bit PG12 stop limit not
    applicable)
[DATABASES]
  7
  name        xid age  of freeze max  mxid age  xids left
  esrep       5578     0%             0         -
  kingbase    5578     0%             0         -
  oneta_demo  5578     0%             0         -
  security    5578     0%             0         -
  template0   5578     0%             0         -
  template1   5578     0%             0         -
  test        5578     0%             0         -
[TABLES IN TEST]
  176, oldest first
  information_schema.sql_features  table
    xid_age=5578  mxid_age=0  heap_est=56 kB
  ...
  • kbdiag vacuum — dead tuples and autovacuum blockers in the current database
  • kbdiag txn — oldest running transaction or 2PC holding back freeze horizon
  • kbdiag slots — inactive replication slots retaining xmin