pub struct MetadataCompactionLeaseState {
pub job_id: MetadataCompactionId,
pub namespace_id: NamespaceId,
pub owner_id: String,
pub status: MetadataCompactionLeaseStatus,
pub started_at_ms: u64,
pub heartbeat_at_ms: u64,
}Expand description
Says who owns the objects under one streaming metadata compaction’s job prefix.
The lease carries lifecycle ownership and nothing else: no cursor, no output descriptor, no offset, no progress. Two parties write it. The job creates it, refreshes it by compare-and-swap while it runs, and stops writing it once its output is published. Garbage collection claims an expired lease by compare-and-swap and reclaims the prefix behind it (format spec, “Garbage collection”, rule 12). Whoever wins that compare-and-swap owns the prefix; the loser has lost it for good.
Nothing about a job’s correctness depends on the object surviving — a job that loses its lease loses its output to a later pass and runs again, which is what every other way a job can end already costs.
Fields§
§job_id: MetadataCompactionIdJob this lease belongs to, which is also the prefix its output sits under.
namespace_id: NamespaceIdNamespace whose family group the job is rebuilding.
owner_id: StringWriter identity the job runs under, for an operator reading the object.
status: MetadataCompactionLeaseStatusWho owns the prefix: the job that wrote the lease, or the collector that claimed it.
started_at_ms: u64Unix-millisecond stamp of the job’s first lease write.
heartbeat_at_ms: u64Unix-millisecond stamp of the most recent lease write, and the only
input to whether an active lease has expired.
Trait Implementations§
Source§impl Clone for MetadataCompactionLeaseState
impl Clone for MetadataCompactionLeaseState
Source§fn clone(&self) -> MetadataCompactionLeaseState
fn clone(&self) -> MetadataCompactionLeaseState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more