Scans backwards from the latest checkpoint to find the most recent checkpoint with valid checksums. Used for corruption recovery.
Value
A checkpoint list (from read_checkpoint()), or NULL if no
valid checkpoint is found.
Details
This function implements the corruption recovery algorithm:
Get list of all checkpoint IDs
Start from the highest ID
Try to read each checkpoint (validates checksums)
If fingerprint is provided, also validate fingerprint
Return first valid checkpoint found
Return NULL if no valid checkpoint found
Examples
if (FALSE) { # \dontrun{
# Find latest valid checkpoint (any fingerprint)
checkpoint <- get_latest_valid_checkpoint("/path/to/results")
# Find latest valid checkpoint with matching fingerprint
checkpoint <- get_latest_valid_checkpoint(
"/path/to/results",
config_fingerprint = expected_fingerprint
)
} # }