pub struct SnapshotRoots {
pub bindings: BTreeSet<(String, String)>,
pub checkpoints: BTreeSet<(String, String)>,
pub archived_checkpoints: BTreeSet<(String, String)>,
pub lane_heads: BTreeSet<(String, String)>,
}Expand description
Everything that keeps a lane rev alive, kept apart by where the claim came from so cleanup can explain retained disk instead of just retaining it.
Checkpoints are roots even for instances whose binding record has been archived. A checkpoint pointing at a pruned rev is not a smaller store, it is a broken undo.
Fields§
§bindings: BTreeSet<(String, String)>Claimed by a surviving instance’s tracker binding.
checkpoints: BTreeSet<(String, String)>Claimed by any checkpoint record, live or archived.
archived_checkpoints: BTreeSet<(String, String)>The subset of checkpoints claimed only by instances whose binding
record is gone. These are the claims a purge can release, so cleanup
can say so instead of reporting retained disk with no way out.
lane_heads: BTreeSet<(String, String)>Claimed by a lane’s own head (LATEST), which new instances project.
Implementations§
Source§impl SnapshotRoots
impl SnapshotRoots
Sourcepub fn collect(
store: &MetadataStore,
branches: &[BranchInstance],
archived: ArchivedCheckpoints,
) -> Result<Self>
pub fn collect( store: &MetadataStore, branches: &[BranchInstance], archived: ArchivedCheckpoints, ) -> Result<Self>
branches is the set of instances that survive the cleanup pass, not
everything on disk — a record about to be archived must not keep its
unreferenced captures alive.
archived says what to do with the checkpoint logs of instances that
have no surviving record: Keep (the default) treats them as roots
like any other checkpoint, Purge ignores them, because the caller is
discarding them in the same pass — which is what makes a purging dry
run report exactly what the real run would remove.
pub fn contains(&self, tracker: &str, rev: &str) -> bool
Sourcepub fn pinned_only_by_checkpoints(
&self,
) -> impl Iterator<Item = &(String, String)>
pub fn pinned_only_by_checkpoints( &self, ) -> impl Iterator<Item = &(String, String)>
Revs held only because some checkpoint references them — the disk a user might otherwise expect cleanup to have reclaimed.
Sourcepub fn pinned_only_by_archived_checkpoints(
&self,
) -> impl Iterator<Item = &(String, String)>
pub fn pinned_only_by_archived_checkpoints( &self, ) -> impl Iterator<Item = &(String, String)>
Of those, the ones no live instance’s checkpoint also claims: purging the archived logs would release exactly these.
Trait Implementations§
Source§impl Clone for SnapshotRoots
impl Clone for SnapshotRoots
Source§fn clone(&self) -> SnapshotRoots
fn clone(&self) -> SnapshotRoots
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more