Durable identity on /var/lib/xratu¶
A node's identity and its position in the control plane's stream live on one
volume mounted at /var/lib/xratu. This page is the layout of that volume, the
write discipline every file on it follows, and what the node does when a file
it reads back is damaged, so a failed start can be traced to one file.
For the claim that backs the volume and its retention policy, see Durable runtime state.
The volume¶
flowchart LR
subgraph VOL["/var/lib/xratu, one claim per node"]
direction TB
subgraph ID["identity/"]
direction TB
S[("xratud.bootstrap.json<br/>seed")]
I[("xratud.identity.json<br/>identity state")]
C[("xratud.runtime.cache.json<br/>runtime cache")]
end
subgraph CU["cursor/"]
direction TB
W[("xratud_watch_cursor_*.json<br/>one per logical and process identity")]
end
end
INIT["Init container"]
XD["xratud"]
INIT -->|"writes"| S
INIT -->|"writes"| I
S -->|"reads"| XD
I -->|"reads"| XD
XD -->|"reads and writes"| C
XD -->|"reads and writes"| W
The identity directory is written by enrollment and read by the daemon; the cursor directory is the daemon's own. The whole volume belongs to one node, so deleting it replaces the node, and keeping it keeps the node across restart, reschedule and scale-down.
Every write is atomic¶
The identity state and the cursor are written the same way: the new document is written to a temporary file beside the original, flushed to disk, and renamed over the original. A rename is atomic on the volume, so a node that stops during a write reads back either the previous document or the new one.
The seed is written once per exchange by the init container, and read on every start after that.
What each file holds¶
| File | Written by | Holds |
|---|---|---|
identity/xratud.bootstrap.json |
Init container, per exchange | Identity set, runtime credential, invitation scope, discovery pin, control-plane endpoint |
identity/xratud.identity.json |
Init container, per exchange | The identities the seed was issued against, for the continuity check |
identity/xratud.runtime.cache.json |
xratud |
Cached runtime configuration |
cursor/xratud_watch_cursor_*.json |
xratud, per cycle |
The assignment cursor record, digest and identity binding |
What a damaged file does¶
Each file is validated when it is read, and the outcome depends on which file it is.
The seed or the identity state. A start with a seed that fails validation, or a seed that disagrees with the identity state, stops before any component is built:
See Enrollment runtime and identity state.
The cursor. A cursor that cannot be read, fails its digest, violates its ordering, or is bound to a different identity is marked corrupt. The node starts from its configured initial revision, holds the corruption as state, and reports it, which is the condition the control plane answers with a snapshot and a resume point. See Recovery contracts.
A damaged identity stops the node, because every later call would be made under it. A damaged position is repaired from the control plane, which holds the authoritative stream.
Stale cursor files are removed¶
Cursor files are named from the logical and process identities, so a process lifecycle can leave a file from an earlier instance behind. On start the node removes cursor files older than 30 days from the cursor directory.
Sizing¶
The volume holds small JSON documents. The default claim of 1Gi covers the identity files and cursors with a wide margin; artifact bytes, images and payload bodies live elsewhere.