pub enum StateProviderEvent {
UpdateEpoch {
epoch: Epoch,
previous_epoch_last_lsn: Lsn,
reply: Sender<Result<()>>,
},
GetLastCommittedLsn {
reply: Sender<Result<Lsn>>,
},
GetCopyContext {
reply: Sender<Result<OperationStream>>,
},
GetCopyState {
up_to_lsn: Lsn,
copy_context: OperationStream,
reply: Sender<Result<OperationStream>>,
},
OnDataLoss {
reply: Sender<Result<bool>>,
},
}Expand description
State provider callbacks delivered on the state_provider channel. Role-specific.
Variants§
UpdateEpoch
Epoch changed (secondaries only).
Primary gets epoch via ChangeRole, not UpdateEpoch.
Operations with LSN above previous_epoch_last_lsn from the old
epoch may be stale (uncommitted zombie primary writes).
GetLastCommittedLsn
“What’s your last applied LSN?” (secondary, during build/catchup)
GetCopyContext
“What state do you already have?” (new idle secondary, during build)
Fields
§
reply: Sender<Result<OperationStream>>GetCopyState
“Produce state for this secondary” (primary, during build_replica)
OnDataLoss
“Quorum was lost, data loss possible” (new primary after quorum loss)
Auto Trait Implementations§
impl Freeze for StateProviderEvent
impl !RefUnwindSafe for StateProviderEvent
impl Send for StateProviderEvent
impl Sync for StateProviderEvent
impl Unpin for StateProviderEvent
impl UnsafeUnpin for StateProviderEvent
impl !UnwindSafe for StateProviderEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request