Module checkpoint

Module checkpoint 

Source

Structs§

CheckpointData
Persisted checkpoint data recording the current file and line position.

Constants§

CHECKPOINT_TEMP_MAX_AGE
Age past which a leftover checkpoint temp file is treated as abandoned. A committed write renames its temp file into place within microseconds of creating it. A temp file older than this was never renamed, which means the process that created it exited before finishing the write.
CHECKPOINT_TEMP_PREFIX
Prefix reserved for checkpoint files whose atomic writes are still in progress.

Functions§

is_reserved_checkpoint_name
Returns whether name would produce a checkpoint file that collides with the reserved temporary-write namespace. Such a name cannot be used because a directory scan would treat its checkpoint as an in-progress write and ignore it.
sweep_orphaned_temp_files
Remove checkpoint temp files in directory left behind by a process that crashed between writing and renaming a checkpoint. Only entries older than max_age are removed, leaving a temp file currently being written by another consumer process untouched. Best-effort: a missing directory or a per-entry failure is skipped rather than reported.