Skip to main content

Module checkpoint

Module checkpoint 

Source
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: crc32fast over the payload bytes.
  • last_applied_id semantics: replay log entries with id (>) last_applied_id.
  • Atomicity: CheckpointFile writes via Directory::atomic_write.

Structs§

CheckpointFile
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.