Expand description
Disk payload store for the crate::cache::offload::OffloadRepository
decorator.
DiskPayloadStore holds content-addressed payload blob files under a
dedicated directory, addressed by the blob names the decorator
computes. A background sweeper reclaims dead blobs by their
name-encoded death epoch and stale .tmp leftovers by age, exiting
when the context-owned shutdown token fires.
§Blob lifecycle
Blob names are {blake3-128hex(key)}.{death_epoch_secs}.{blake3-128hex( bytes || content_type-discriminant)}.blob. The death epoch is encoded
in the name so the sweeper can reclaim dead blobs by file name alone,
without consulting the index.
§Failure policy
- Writes are tmp-then-rename so a partially written blob is never visible under its final name; write failures surface to the decorator, whose inline fallback applies.
- A vanished blob reads as
Ok(None); a blob that exists but cannot be read (e.g.PermissionDenied) surfaces asErrper ADR-0023 Contract C1. unlinkcounts an already-absent blob as success;clearnever fails — per-blob unlink failures WARN and the scan continues.
Structs§
- Disk
Payload Store PayloadStorethat keeps offloaded payload blobs as files underdir, with a background death-epoch sweeper.