Skip to main content

CheckpointDecisionStore

Struct CheckpointDecisionStore 

Source
pub struct CheckpointDecisionStore { /* private fields */ }
Expand description

Durable checkpoint metadata store.

Implementations§

Source§

impl CheckpointDecisionStore

Source

pub async fn allocate_checkpoint_id_at_least( &self, minimum: u64, ) -> Result<u64, DecisionError>

Allocate the next globally ordered checkpoint ID at or above minimum.

Shared stores advance exactly one ID with native compare-and-swap. A certified local single writer reserves a durable range in the deployment singleton, consumes it in memory, and burns any unused suffix after restart.

§Errors

Object-store I/O, malformed or foreign durable state, a shared store without conditional update support, or exhaustion of the u64 ID space.

Source§

impl CheckpointDecisionStore

Source

pub async fn create_committed_checkpoint( &self, index: &CommittedCheckpointIndex, ) -> Result<CommittedCheckpointRef, DecisionError>

Create the canonical content-addressed body for a committed checkpoint index.

Identical retries converge on the existing immutable body. The returned reference is safe to publish only after this method succeeds.

§Errors

Object-store I/O, malformed index content, deployment mismatch, or a conflicting body.

Source

pub async fn load_committed_checkpoint( &self, reference: &CommittedCheckpointRef, ) -> Result<CommittedCheckpointIndex, DecisionError>

Load and verify one exact content-addressed committed checkpoint index.

Verification covers the object path, recorded and observed lengths, canonical JSON body, SHA-256 reference, deployment identity, and committed-index invariants.

§Errors

Object-store I/O, a missing object, malformed content, or any reference mismatch.

Source

pub async fn seal_aborted_committed_checkpoint_candidate( &self, index: &CommittedCheckpointIndex, ) -> Result<(), DecisionError>

Permanently seal the exact content-addressed candidate for an aborted attempt.

The seal occupies the candidate’s existing path, so an in-flight conditional create can either win and be replaced or lose to the seal. Identical retries converge.

§Errors

The candidate is malformed or foreign, the path contains different content, or object-store I/O cannot be reconciled to the exact seal.

Source

pub async fn delete_committed_checkpoint( &self, reference: &CommittedCheckpointRef, ) -> Result<(), DecisionError>

Delete one exact committed index after validating any extant body.

Missing objects and ambiguous deletes that removed the object are successful retries.

§Errors

The reference, extant index, deployment identity, or object-store operation is invalid.

Source§

impl CheckpointDecisionStore

Source

pub async fn load_or_create_deployment_id( &self, ) -> Result<String, DecisionError>

Load the checkpoint namespace’s create-once deployment incarnation, creating it when the durable store is empty. Concurrent cluster members converge through object-store CAS.

§Errors

Object-store I/O or a malformed/conflicting persisted identity.

Source§

impl CheckpointDecisionStore

Source

pub async fn begin_checkpoint_artifact_inventory( &self, inventory: CheckpointArtifactInventory, ) -> Result<CheckpointArtifactInventoryUpdateResult, DecisionError>

Durably admit one exact local attempt before any checkpoint artifact is written.

Equal retries converge. A different active attempt or a reused terminal attempt conflicts.

§Errors

Object-store I/O or a malformed, cluster, or foreign-deployment inventory.

Source

pub async fn complete_checkpoint_artifact_cleanup( &self, expected: &CheckpointArtifactInventory, ) -> Result<CheckpointArtifactInventoryUpdateResult, DecisionError>

Clear an exact local artifact inventory after its durable Abort paths are sealed.

§Errors

Object-store I/O or a malformed, cluster, or foreign-deployment inventory.

Source

pub async fn record_outcome( &self, epoch: u64, checkpoint_id: u64, scope: CheckpointScope, assignment_fence: Option<CheckpointAssignmentFence>, leader_proof: Option<LeaderProof>, verdict: CheckpointVerdict, committed_checkpoint: Option<CommittedCheckpointRef>, ) -> Result<RecordOutcomeResult, DecisionError>

Publish the authoritative local terminal outcome.

The singleton CAS is the decision: a crash before it leaves the attempt unresolved, while a crash after it leaves both the latest terminal and latest Commit directly recoverable. Equal retries converge; stale epochs and conflicting outcomes return the durable winner.

§Errors

Object-store I/O, malformed metadata, a forked Commit predecessor, or cluster authority.

Source

pub async fn checkpoint_decision_head( &self, ) -> Result<Option<CheckpointDecisionHead>, DecisionError>

Read the exact authoritative local decision head without listing storage.

§Errors

Object-store I/O or malformed/foreign head metadata.

Source

pub async fn latest_terminal_outcome( &self, ) -> Result<Option<CheckpointOutcome>, DecisionError>

Read the latest authoritative local terminal outcome without listing storage.

§Errors

Object-store I/O or malformed/foreign head metadata.

Source

pub async fn latest_committed_outcome( &self, ) -> Result<Option<CheckpointOutcome>, DecisionError>

Read the latest authoritative local Commit without listing storage.

§Errors

Object-store I/O or malformed/foreign head metadata.

Source§

impl CheckpointDecisionStore

Source

pub async fn begin_checkpoint_retention( &self, protected: &CommittedCheckpointRef, ) -> Result<CheckpointRetentionUpdateResult, DecisionError>

Start or resume retention for the authoritative latest local Commit.

§Errors

The protected cut is stale, its chain is invalid, or durable metadata cannot be updated.

Source

pub async fn advance_checkpoint_retention( &self, expected: &CheckpointRetentionState, ) -> Result<CheckpointRetentionUpdateResult, DecisionError>

Advance one completed retention phase with an exact compare-and-swap.

§Errors

The expected state is idle or invalid, or durable metadata cannot be updated.

Source

pub async fn checkpoint_retention_state( &self, ) -> Result<Option<CheckpointRetentionState>, DecisionError>

Read the exact local retention state without listing storage.

§Errors

Object-store I/O or malformed/foreign metadata.

Source§

impl CheckpointDecisionStore

Source

pub async fn sink_open_witness( &self, ) -> Result<Option<CheckpointSinkOpenWitness>, DecisionError>

Read the singleton sink-open owner record.

§Errors

Object-store I/O, malformed/non-canonical metadata, or foreign deployment state.

Source

pub async fn create_sink_open_witness( &self, pipeline_identity: PipelineIdentity, participant_id: u64, attempt: CheckpointAttempt, committable_sinks: Vec<String>, ) -> Result<CheckpointSinkOpenWitness, DecisionError>

Create the durable witness before invoking any checkpoint-committable sink begin call.

committable_sinks must already be strictly sorted and unique so duplicate runtime names cannot be silently collapsed into one recovery participant.

§Errors

Object-store I/O, invalid input, or any malformed, foreign, or conflicting live witness.

Source

pub async fn clear_sink_open_witness( &self, expected: &CheckpointSinkOpenWitness, ) -> Result<(), DecisionError>

Close exactly the supplied witness after its attempt is terminal or fully rolled back.

Closure durably replaces the open state. The tombstone makes an old conditional write harmless after a successor opens and gives ambiguous responses an exact state to reconcile.

§Errors

Object-store I/O or a malformed, foreign, or different live witness.

Source§

impl CheckpointDecisionStore

Source

pub fn new(store: Arc<dyn ObjectStore>) -> Self

Wrap shared storage that must provide native conditional updates.

Source

pub fn local_filesystem(root: impl AsRef<FsPath>) -> Result<Self, DecisionError>

Open crash-durable checkpoint metadata in a caller-owned local directory. The caller must retain its exclusive namespace lease for the store’s write lifetime.

§Errors

Returns an I/O error when the directory cannot be created, synchronized, or opened.

Trait Implementations§

Source§

impl Debug for CheckpointDecisionStore

Source§

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

Formats the value using the given formatter. Read more

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
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
§

impl<T> Pointee for T

§

type Metadata = ()

The metadata type for pointers and references to this type.
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more