pub fn live_blob_hashes<'a>(
records: impl IntoIterator<Item = &'a Record>,
) -> Result<BTreeSet<ContentHash>>Expand description
The mark set: every blob hash these records still need. records must be
the store’s raw records, tombstones included.
Five things reference a blob (gonzalo#292, gonzalo#323, gonzalo#327):
- a record whose body is a
Body::Blob— the bytes are its content; - a tombstone’s
deleted_blob. A tombstone pins its blob, so a delete never destroys content that a peer can still resurrect by syncing the record back, and re-putting the same content after a delete does not have to re-upload it. The pin lasts exactly as long as the tombstone: collecting it past the horizon releases the blob to the next sweep; - every slice a graph manifest names (ADR 0012) — blobs referenced from a record’s contents rather than from its body;
- every shard a vector manifest names (ADR 0027) — the same contents-not-body reference, for a durable vector index’s shard blobs;
- every blob named by the retained body of a manifest tombstone
(
deleted_kind, ADR 0029) — the same references as the two manifest arms above, kept alive after the delete so the index can still be restored. Released when the tombstone is collected.
Marking any one of the five alone deletes the other four’s blobs, so this unions them from the records rather than from a caller’s idea of liveness.