Expand description
The KIP-630 .checkpoint artifacts under a node’s metadata directory.
It is public because a broker-only observer keeps its __cluster_metadata
snapshot in the same on-disk layout, and reads and writes it with these
helpers rather than with a second file format of its own.
The KIP-630 .checkpoint artifacts under the controller’s metadata
directory: their filename encoding, atomic write, id ordering, and the
two-snapshot retention the engine keeps the directory at.
Functions§
- checkpoint_
id_ is_ newer - latest_
checkpoint_ id - Scan
dirfor<end_offset>-<epoch>.checkpointartifacts and return the highest(end_offset, epoch)id, orNonewhen the directory is absent or holds no checkpoint. - load_
checkpoint_ by_ id - Read a specific checkpoint
<end_offset>-<epoch>.checkpointby id, orNoneif it is absent (the leader’sFetchSnapshotserve path). - load_
latest_ checkpoint - Scan
dirfor<end_offset>-<epoch>.checkpointartifacts, pick the highest(end_offset, epoch), and return its raw bytes. - retain_
latest_ checkpoint - Delete every
.checkpointindirexcept the latest(end_offset, epoch). - retain_
recent_ checkpoints - Delete every
.checkpointindirexcept the two newest(end_offset, epoch)ids, after the controller’s snapshot+prune or an install. Best-effort: read/remove errors are ignored. - write_
checkpoint - Write a KIP-630
.checkpointartifact (bytes only) atomically and durably: the temporary file is synced before the rename and the directory after it, as Kafka’sFileRawSnapshotWriter.freezedoes.