pub struct ReplicaBootstrapper { /* private fields */ }Expand description
Manages bootstrap lifecycle using AdminIntentLog for crash-resumability.
§Single-resumer policy
Each node only resumes its own intents (args.replica_id == node_id).
If multiple unfinished intents exist for this node (unexpected), none is
resumed — a fresh bootstrap is started and the dangling intents are left for
operator investigation via crate::telemetry::operator_event::OperatorEvent::DanglingAdminIntent.
Implementations§
Source§impl ReplicaBootstrapper
impl ReplicaBootstrapper
pub fn new(node_id: impl Into<String>) -> Self
Sourcepub fn scan_for_resume(&self, log: &AdminIntentLog) -> Option<ResumePoint>
pub fn scan_for_resume(&self, log: &AdminIntentLog) -> Option<ResumePoint>
Scan log for unfinished bootstrap intents.
Calls AdminIntentLog::scan_and_report first — this emits a
DanglingAdminIntent operator event for every unfinished intent.
Then applies the single-resumer policy: returns a ResumePoint only
if exactly one unfinished ReplicaBootstrap intent for this node_id
exists with at least one checkpoint record carrying last_applied_lsn.
Sourcepub fn begin<'a>(
&self,
log: &'a AdminIntentLog,
source_lsn: u64,
target_lsn_hint: u64,
) -> Result<BootstrapHandle<'a>, IntentLogError>
pub fn begin<'a>( &self, log: &'a AdminIntentLog, source_lsn: u64, target_lsn_hint: u64, ) -> Result<BootstrapHandle<'a>, IntentLogError>
Begin a fresh bootstrap intent.
source_lsn: LSN at the primary when bootstrap starts.
target_lsn_hint: expected completion LSN (informational).
Auto Trait Implementations§
impl Freeze for ReplicaBootstrapper
impl RefUnwindSafe for ReplicaBootstrapper
impl Send for ReplicaBootstrapper
impl Sync for ReplicaBootstrapper
impl Unpin for ReplicaBootstrapper
impl UnsafeUnpin for ReplicaBootstrapper
impl UnwindSafe for ReplicaBootstrapper
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§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>
T in a tonic::Request