Expand description
Generic checkpoint file (single snapshot blob).
This is a generic building block: store one postcard-encoded snapshot with a small header and CRC32. Higher layers decide when to checkpoint and what the snapshot schema is.
§Public invariants (must not change without a format bump)
- Header:
[CHECKPOINT_MAGIC][FORMAT_VERSION][last_applied_id:u64][payload_len:u64][crc32:u32](little-endian for integers). - Checksum:
crc32fastover the payload bytes. last_applied_idsemantics: replay log entries with id (>)last_applied_id.- Atomicity:
CheckpointFilewrites viaDirectory::atomic_write.
Structs§
- Checkpoint
File - Read/write checkpoint files in a
Directory.
Constants§
- MAX_
CHECKPOINT_ PAYLOAD_ BYTES - Upper bound on checkpoint payload size, to prevent allocating absurd buffers from corrupt/malicious headers.