Expand description
Finding the two restore inputs that live on a node’s disk, and naming the capture they are written into.
Neither file has a stable name. The RLMM snapshot does — it is always
<log.dir>/remote-log-metadata/snapshot — but the controller metadata
checkpoint is <end-offset>-<epoch>.checkpoint and there are several of
them, in one of two directories under the metadata log directory,
depending on whether the node runs a controller. Picking the right one is
this module’s whole job, and it is a pure function over directory listings
so a test can pin the choice without a broker.
Structs§
- Checkpoint
Id - The identity of a metadata checkpoint, as its file name encodes it.
- Metadata
Checkpoint - A metadata checkpoint file and the id its name encodes.
Constants§
- CONTROLLER_
CHECKPOINT_ DIR - Where a node that runs a controller keeps its metadata checkpoints, under the metadata log directory: Kafka’s metadata partition directory.
- OBSERVER_
CHECKPOINT_ DIR - Where a broker-only node keeps the checkpoints its metadata observer wrote, under the metadata log directory.
- RLMM_
SNAPSHOT_ RELATIVE - The RLMM snapshot’s path under a log directory.
Functions§
- capture_
id - The id a capture taken at
now_mscarries, which is also its directory name inside the archive. - capture_
key - The archive-relative key of one artifact inside one capture.
- checkpoint_
id - The
CheckpointIda checkpoint file name encodes, orNonewhen the name is not a checkpoint. - file_
names - Every file name directly inside
dir. An absent or unreadable directory is an empty list: a node can lack either checkpoint directory, and that is not a failure. - holds_
a_ topic - Whether a checkpoint’s decoded records hold a topic.
- newest_
checkpoint - The newest checkpoint among
names, by(end_offset, epoch). - newest_
metadata_ checkpoint - The newest metadata checkpoint under
log_dir, the node’s metadata log directory, looking in the controller’s directory and then in the observer’s.