Skip to main content

Crate shardline_fsck

Crate shardline_fsck 

Source
Expand description

Storage integrity checking logic for the Shardline server ecosystem.

This crate provides pure fsck functions that operate on explicit store parameters rather than server configuration.

§Quick start

The issue and report types are pure data, so you can build and inspect them without touching any storage:

use shardline_fsck::{
    FsckIssue, FsckIssueDetail, FsckIssueKind, FsckReport,
};

let issue = FsckIssue {
    kind: FsckIssueKind::MissingChunk,
    location: "protocols/xet/global/chunks/abcd".to_owned(),
    detail: FsckIssueDetail::HashMismatch {
        expected_hash: "expected...".to_owned(),
        observed_hash: "observed...".to_owned(),
    },
};
assert_eq!(issue.kind.as_str(), "missing_chunk");

let report = FsckReport {
    latest_records: 10,
    version_records: 10,
    inspected_chunk_references: 20,
    inspected_dedupe_shard_mappings: 0,
    inspected_reconstructions: 0,
    inspected_webhook_deliveries: 0,
    inspected_provider_repository_states: 0,
    issues: vec![issue],
};
assert!(!report.is_clean());
assert_eq!(report.issue_count(), 1);

To run a real check, use run_fsck_with_stores with explicit record, index, and object-store adapters, or run_local_fsck for the local-filesystem layout.

Structs§

FsckIssue
One integrity issue reported by the checker.
FsckReport
Integrity-check report.

Enums§

FsckError
Fsck operation failure.
FsckIssueDetail
Integrity issue detail.
FsckIssueKind
Integrity issue kinds for the checker.
FsckReconstructionPlanDetail
Reconstruction-plan detail for fsck issues.
ProviderRepositoryStateTimestampField
Provider repository state timestamp field.

Constants§

WEBHOOK_DELIVERY_FUTURE_SKEW_SECONDS

Functions§

run_fsck_with_stores
Runs local filesystem integrity checks over Shardline metadata and chunk storage using explicit store parameters.
run_local_fsck
Runs local filesystem integrity checks over Shardline metadata and chunk storage.

Type Aliases§

LocalFsckIssue
Backward-compatible local fsck issue alias.
LocalFsckIssueKind
Backward-compatible local fsck issue-kind alias.
LocalFsckReport
Backward-compatible local fsck report alias.