Skip to main content

GcResponse

Struct GcResponse 

Source
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: NamespaceId

Namespace the pass ran against.

§deleted_wal_segments: u64

Unreferenced WAL segments deleted.

§deleted_metadata_tables: u64

Unreferenced metadata tables deleted.

§deleted_manifests: u64

Unreferenced manifests deleted.

§deleted_checkpoint_records: u64

Released checkpoint records deleted after their grace window.

§released_fork_checkpoints: u64

Fork-owned checkpoint records released because their target namespace is provably gone.

§released_expired_checkpoints: u64

Checkpoint records released because their expiry passed, or because they sit on a terminally deleted namespace.

§deleted_upload_sessions: u64

Upload-session control objects deleted after the reap window.

§deleted_content_objects: u64

Content 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: u64

Active checkpoint records released because their basis manifest is verifiably gone.

§retained_candidates: u64

Candidates retained at delete time (grace window, missing timestamps, or reachable from the fresh root set).

§retained: RetainedCandidates

The 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: bool

True when ambiguous roots suppressed manifest/table deletion.

§content_reclamation_deferred: bool

True 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

Source

pub fn empty(namespace_id: NamespaceId) -> Self

An empty report for namespace_id, before any candidate is examined.

Source

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

Source§

fn clone(&self) -> GcResponse

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GcResponse

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for GcResponse

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for GcResponse

Source§

impl PartialEq for GcResponse

Source§

fn eq(&self, other: &GcResponse) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for GcResponse

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for GcResponse

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.