pub struct MigrationState {
pub vshard_id: u32,
pub source_group: u64,
pub target_group: u64,
pub source_node: u64,
pub target_node: u64,
pub phase: MigrationPhase,
pub write_pause_budget_us: u64,
pub started_at: Option<Instant>,
}Expand description
Full state of a vShard migration.
Fields§
§vshard_id: u32vShard being migrated.
source_group: u64Source Raft group.
target_group: u64Target Raft group.
source_node: u64Source node (current owner).
target_node: u64Target node.
phase: MigrationPhaseCurrent phase.
write_pause_budget_us: u64Maximum write-pause budget in microseconds.
started_at: Option<Instant>When migration was initiated.
Implementations§
Source§impl MigrationState
impl MigrationState
pub fn new( vshard_id: u32, source_group: u64, target_group: u64, source_node: u64, target_node: u64, write_pause_budget_us: u64, ) -> Self
Sourcepub fn start_base_copy(&mut self, bytes_total: u64)
pub fn start_base_copy(&mut self, bytes_total: u64)
Start Phase 1: Base Copy.
Sourcepub fn update_base_copy(&mut self, bytes_transferred: u64)
pub fn update_base_copy(&mut self, bytes_transferred: u64)
Update base copy progress.
Sourcepub fn start_wal_catchup(&mut self, start_lsn: u64, source_lsn: u64)
pub fn start_wal_catchup(&mut self, start_lsn: u64, source_lsn: u64)
Transition to Phase 2: WAL Catch-up.
Sourcepub fn update_wal_catchup(&mut self, current_lsn: u64, source_lsn: u64)
pub fn update_wal_catchup(&mut self, current_lsn: u64, source_lsn: u64)
Update WAL catch-up progress.
Sourcepub fn is_catchup_ready(&self) -> bool
pub fn is_catchup_ready(&self) -> bool
Check if WAL lag is low enough to proceed to cut-over.
Sourcepub fn start_cutover(&mut self, estimated_pause_us: u64) -> Result<()>
pub fn start_cutover(&mut self, estimated_pause_us: u64) -> Result<()>
Attempt to start Phase 3: Atomic Cut-over.
Returns Err if the estimated pause would exceed the budget.
pub fn is_active(&self) -> bool
pub fn vshard_id(&self) -> u32
pub fn phase(&self) -> &MigrationPhase
Trait Implementations§
Source§impl Clone for MigrationState
impl Clone for MigrationState
Source§fn clone(&self) -> MigrationState
fn clone(&self) -> MigrationState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MigrationState
impl RefUnwindSafe for MigrationState
impl Send for MigrationState
impl Sync for MigrationState
impl Unpin for MigrationState
impl UnsafeUnpin for MigrationState
impl UnwindSafe for MigrationState
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.