Durable node state layout¶
A node writes to two places. One is a volume that stays with the node across
restarts and carries its identity, its position in the assignment stream and its
closure content store. The other is the process working area, which carries the
spools and local state a single xratud process accumulates and which starts
empty each time.
This page covers both, file by file: what each holds, what writes it and how long it lives.
The two homes and their writers¶
flowchart TB
subgraph VOL["MOUNT AT /var/lib/xratu, retained with the node"]
direction TB
IDD[("identity/")]
CUR[("cursor/")]
CLS[("runtime-closure-store/")]
end
subgraph TMP["PROCESS WORKING AREA, new each start"]
direction TB
OBX[("status outbox spool")]
LSE[("assignment lease state")]
AUD[("audit spool")]
end
BOOT["Enrollment bootstrap<br/>init container"]
ENR["Enrollment and identity refresh"]
WCO["Watch cursor owner"]
CLSM["Closure materialisation"]
MUX["Telemetry mux and status ack"]
WRK["Assignment workers"]
ATT["Audit attestation writer"]
BOOT --> IDD
ENR --> IDD
WCO --> CUR
CLSM --> CLS
MUX --> OBX
WRK --> LSE
ATT --> AUD
MOUNT AT /var/lib/xratu is written by the init container and three long-lived
owners. PROCESS WORKING AREA is written by the three components whose state
lasts one process. The closure store is the one entry in the mount that several
xratud instances on a node share.
The volume¶
The shipped node template mounts a 1Gi ReadWriteOnce claim at
/var/lib/xratu and makes it the process working directory. The enrollment
bootstrap init container writes its seed to the same mount before xratud
starts.
/var/lib/xratu/
identity/
xratud.bootstrap.json enrollment seed written by the bootstrap container
xratud.identity.json enrollment identity state
xratud.runtime.cache.json runtime cache
cursor/
xratud_watch_cursor_<dataplane_uuid>_<dataplane_instance_uuid>.json
runtime-closure-store/ content-addressed closure entries
| File or directory | Holds | Written by |
|---|---|---|
identity/xratud.bootstrap.json |
The enrollment seed the node bootstraps from | The enrollment bootstrap init container |
identity/xratud.identity.json |
dataplane_installation_uuid, dataplane_uuid, dataplane_instance_uuid, enrollment_uuid, cp_instance_uuid, cp_identity_revision |
Enrollment, and re-enrollment for the same installation |
identity/xratud.runtime.cache.json |
The cached runtime configuration the node starts from | Runtime bootstrap |
cursor/xratud_watch_cursor_*.json |
The four-revision assignment watch record | The watch cursor owner, on every advance |
runtime-closure-store/ |
Resolved closure content, verified again before reuse | Closure materialisation |
The identity files are what make re-enrollment for the same
dataplane_installation_uuid idempotent and reuse the existing dataplane_uuid.
See
Durable identity on /var/lib/xratu.
The closure store is node-local and shared: several xratud instances on one
node use the same content-addressed entries, and a project runtime receives only
the opened subtree as a read-only mount on that same node. See
Runtime closure materialization and reconciliation.
The process working area¶
Three paths in the process temporary directory hold the buffers and local
state of one running xratud process. They are named from the node identity and
the instance identity. Each holds work in flight: reports the control plane has
not yet accepted, and the claims and dedupe records of assignments the process is
working on.
xratud_status_outbox_<dataplane_uuid>_<dataplane_instance_uuid>.spool/
logs/ events/ status/ kernel_returns/
segments/ numbered segment files, one record per line
checkpoint.json the open segment, and each segment's count and size
.lock one writer per channel
status_ack_state.json staged and acknowledged status envelopes
kernel-return-cursors.json last acknowledged sequence per runtime instance
xratud_assignment_leases_<dataplane_uuid>_<dataplane_instance_uuid>.state.json
xratud_assignment_leases_<...>.state.json.lock
xratud_audit_<dataplane_uuid>_<dataplane_instance_uuid>_<dataplane_label>.spool/
audit/ attestation/
segments/
chain_state.json per-stream count, open segment and chain position
.lock
| Path | Holds | A record leaves when |
|---|---|---|
| Status outbox spool | Telemetry per channel that the control plane has not yet accepted, the status acknowledgement state and the kernel return positions | The control plane accepts it |
| Assignment lease state | Local assignment claims and execution dedupe records | The assignment is finalized |
| Audit spool | Sealed audit and attestation segments with their chain state | The segment is delivered and compacted |
How a write is made safe¶
Every one of these files is written whole and replaced in one step:
1. write the new content to a temporary file in the same directory
2. flush it and fsync the descriptor
3. rename it over the target
A reader therefore sees the previous content or the new content. Segment appends are flushed before they return, and the two state files that several writers touch take an exclusive lock on a sibling lock file first.
The local budgets¶
| Spool | Segment limit | Budget |
|---|---|---|
| Telemetry outbox, per channel | 128 records or 256 KiB | 64 MiB |
| Audit and attestation | 256 records or 512 KiB | 128 MiB |
An append that would pass a budget is refused and the operation that produced it fails with it, so a node under a long outage reports a failure while its disk stays within what was planned for. The performance governor holds work back before a spool reaches its limit. See Scaling and the performance governor.
Sizing the volume¶
The 1Gi default covers identity, cursors and a modest closure store. The closure store is the entry that grows with use, because it holds resolved content for every project version the node has served. Size the claim from the number of distinct project versions a node carries and the size of their closures. See Sizing and capacity planning.
Related¶
- Cursor separation for which positions sit where.
- Persisting cursors across restart for the write path in detail.
- Rebuilding node state after restart for what a starting node reads from each file.