Skip to main content

verify_partition_dir

Function verify_partition_dir 

Source
pub fn verify_partition_dir(
    dir: &Path,
    trusted: &TrustedKeys,
) -> Result<VerifyReport, AuditError>
Expand description

Verify the audit partition under dir.

This function reads all *.log segment files in base-offset order, which is the filename order. It decodes each RecordBatch directly and not through Log::open: that path runs recovery and truncation, which would silently mask tail corruption. The function then recomputes the hash-chain, and it validates every checkpoint signature against trusted.

ยงErrors

Returns an error if the verifier cannot read dir. Returns an error if the verifier cannot read one of the segment files. A detected break in the chain or in a signature is not an error: it is an Ok report with ok set to false.