Skip to main content

CoordinationEvent

Enum CoordinationEvent 

Source
#[non_exhaustive]
pub enum CoordinationEvent { Gained { split: SplitSpec, epoch: LeaseEpoch, progress: Option<SplitProgress>, }, Lost { split: SplitId, }, RevokeRequested { split: SplitId, }, Quarantined { split: SplitId, attempts: u32, }, AllComplete, Stalled { completed: u64, quarantined: u64, }, }
Expand description

Ownership or job-state change surfaced by SplitCoordinator::poll.

Events for one split are ordered: a split is Gained before it can be Lost, and a re-Gained split always carries a higher LeaseEpoch than the tenancy it replaces.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Gained

This instance now holds the lease for the split and must start (or resume) processing it.

Fields

§split: SplitSpec

The split now owned, descriptor included, because the gaining worker never saw the planner run.

§epoch: LeaseEpoch

Fencing token for this tenancy.

§progress: Option<SplitProgress>

The last fenced-committed progress to resume from. None for a split that has never committed.

§

Lost

The lease was lost, either seized by a peer after expiry, stolen for balance, or self-fenced after renewals could not reach the backend. The source must stop the split promptly and must not commit it again (a late commit is rejected as CoordinationErrorKind::Fenced regardless; this event is the cooperative fast path).

Fields

§split: SplitId

The split no longer owned.

§

RevokeRequested

The leader has stopped assigning this split to this instance, and wants it back. The owner should stop intake at a safe boundary, chase the split’s tail to a final fenced commit, and release it. The next owner then resumes from a point covering everything this one emitted, so the transfer replays nothing.

The split is leaving either way. A revocation is a decision rather than a proposal. A source that declines (through the driver’s SplitSource::begin_revoke, which defaults to declining) or that does not finish inside drain_deadline has the release forced instead, and its uncommitted tail replays under the next owner. Declining is therefore still safe; it is the expensive way to comply.

The one exception is not the source’s to take. A backend may cancel a revocation its leader took back (the split is named for this instance again while it still holds it), and then nothing is forced. A source cannot observe that and must not wait for it. It also changes little for a source that already accepted: intake stays stopped, the drain still ends by handing the split back, and this instance is the one that gains it again, through a fresh Gained with a new lane. Only a source that declined keeps the split without interruption.

Idempotent: the event may be re-emitted for a split already draining, and a revocation for a split this instance does not hold is a silent no-op.

Fields

§split: SplitId

The split to give up.

§

Quarantined

The split exhausted its delivery attempts (repeated owner deaths or explicit fail reports) and was parked. It will not be re-offered; it stays visible in the store and in the spate_coordination_splits_quarantined gauge, and it blocks AllComplete.

Fields

§split: SplitId

The parked split.

§attempts: u32

Delivery attempts consumed.

§

AllComplete

Final plan and every split committed completed. Bounded sources translate this into SourceEvent::Drained. An instance that owns no splits must keep polling until this arrives; it stands by to cover an owner dying at the finish line.

§

Stalled

Final plan, nothing left runnable or running, but quarantined splits remain, so the job cannot finish cleanly. Surfaced to every instance exactly where AllComplete would have been. The source decides whether this is fatal (the default in the driver) or a drain-with-warning.

Fields

§completed: u64

Splits that completed.

§quarantined: u64

Splits parked in quarantine.

Trait Implementations§

Source§

impl Debug for CoordinationEvent

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
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

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

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

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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