Skip to main content

Module durability

Module durability 

Source
Expand description

:durability-check <ref> — the operator-facing answer to the single most-feared question: “is my data still alive?”

The check walks the chunk graph rooted at <ref>:

  • Fetches the root chunk via /chunks/{ref}.
  • If the root parses as a Mantaray manifest, recursively fetches each fork’s self_address. Forks with target_address that isn’t NULL are counted as leaves but their target’s BMT tree is NOT walked (that’s a v1.4 follow-up — bee-rs would need to stream chunks through the file chunker for a complete answer).
  • If the root doesn’t parse as a manifest, the single-chunk fetch IS the durability answer.

Result is a DurabilityResult with (chunks_total, chunks_lost, chunks_errors). The S13 Watchlist screen records each invocation and surfaces the running history; cmd_status_tx carries the one-line summary back to the command bar.

Mirrors beekeeper’s pkg/check/datadurability but for one operator’s local node + one reference, without the cluster orchestration.

Structs§

CheckOptions
Knobs for the durability walk.
DurabilityResult
Outcome bucket for the running summary. We separate chunks_lost (a 404 on /chunks/{ref}) from chunks_errors (any other failure — timeout, 500, decode error) and from chunks_corrupt (BMT hash of the returned content doesn’t match the requested reference). They have different operator implications: lost = the network truly dropped your data; errors = something flaky that needs a retry; corrupt = a peer or local store returned different bytes than the address asked for (bit-rot, swap-corrupted on-disk chunk, hostile peer).

Functions§

check
Walk the chunk graph rooted at reference and report the result. Times out per-chunk via reqwest’s default; the surrounding tokio task can be cancelled by dropping its handle (the Watchlist screen owns the in-flight handle). BMT verification on by default; swarmscan probe off — see check_with_options.
check_with_options
check with explicit options. Exposed so a future [durability].bmt_verify = false config knob (or a CLI flag) can opt out for very large walks where the keccak cost adds up.