pub struct GcResponse {Show 16 fields
pub namespace_id: NamespaceId,
pub deleted_wal_segments: u64,
pub deleted_metadata_tables: u64,
pub deleted_manifests: u64,
pub deleted_checkpoint_records: u64,
pub released_fork_checkpoints: u64,
pub released_expired_checkpoints: u64,
pub deleted_upload_sessions: u64,
pub deleted_content_objects: u64,
pub released_missing_basis_checkpoints: u64,
pub retained_candidates: u64,
pub retained: RetainedCandidates,
pub degraded_retention: bool,
pub content_reclamation_deferred: bool,
pub next_cursor: Option<String>,
pub next_reclamation_at_ms: Option<u64>,
}Expand description
Result of one mark-and-sweep garbage-collection pass.
Fields§
§namespace_id: NamespaceIdNamespace the pass ran against.
deleted_wal_segments: u64Unreferenced WAL segments deleted.
deleted_metadata_tables: u64Unreferenced metadata tables deleted.
deleted_manifests: u64Unreferenced manifests deleted.
deleted_checkpoint_records: u64Released checkpoint records deleted after their grace window.
released_fork_checkpoints: u64Fork-owned checkpoint records released because their target namespace is provably gone.
released_expired_checkpoints: u64Checkpoint records released because their expiry passed, or because they sit on a terminally deleted namespace.
deleted_upload_sessions: u64Upload-session control objects deleted after the reap window.
deleted_content_objects: u64Content objects reclaimed because their upload session completed, aged past the derived reclamation grace, and nothing the namespace can reach references them. The upload half’s cleanup of abandoned sessions is not counted here: it deletes unconditionally, whether or not the session ever wrote anything.
released_missing_basis_checkpoints: u64Active checkpoint records released because their basis manifest is verifiably gone.
retained_candidates: u64Candidates retained at delete time (grace window, missing timestamps, or reachable from the fresh root set).
retained: RetainedCandidatesThe same total, split by the decision that spared each candidate. The total above stays because it is what every existing consumer reads; this says why.
degraded_retention: boolTrue when ambiguous roots suppressed manifest/table deletion.
content_reclamation_deferred: boolTrue when the pass skipped completed-content reclamation because
the reference collection it needs did not fit in max_objects.
Nothing was ever decided from a partial collection and the rest of
the sweep ran normally; a later pass with room for the whole scan
reclaims what this one left behind.
next_cursor: Option<String>Opaque resume token when more candidates remain. Resuming rebuilds every safety proof; the token carries enumeration position only and is valid only against the same namespace.
next_reclamation_at_ms: Option<u64>The soonest instant still ahead of this pass at which something it retained becomes reclaimable: an open session’s lease plus the grace window, an aborted session’s grace, or a completed session’s derived content-reclamation grace. A scheduler reads this to decide when to come back, so a namespace needs no other side channel to have its reclamation happen.
It reports what this pass saw and nothing more. A pass that stopped
on next_cursor examined only part of the keyspace, and candidates
that age out under a plain grace window on their object timestamps
carry no deadline here at all, so None is never a claim that
nothing is owed.
Always serialized, null included, unlike next_cursor beside it:
a cursor’s presence is what says the enumeration is unfinished,
while this is an answer every pass has — and one whose absence
otherwise makes the response’s shape depend on what happened to be
in the namespace.
Implementations§
Source§impl GcResponse
impl GcResponse
Sourcepub fn empty(namespace_id: NamespaceId) -> Self
pub fn empty(namespace_id: NamespaceId) -> Self
An empty report for namespace_id, before any candidate is examined.
Sourcepub fn retain(&mut self, reason: RetainedReason)
pub fn retain(&mut self, reason: RetainedReason)
Records one retained candidate under the reason that spared it.
The total and the breakdown move together here so they cannot drift: every sweep site names a reason, and no site can count a retention without naming one.
Trait Implementations§
Source§impl Clone for GcResponse
impl Clone for GcResponse
Source§fn clone(&self) -> GcResponse
fn clone(&self) -> GcResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more