Skip to main content

MigrationMessage

Enum MigrationMessage 

Source
pub enum MigrationMessage {
    TakeSnapshot {
        daemon_origin: u64,
        target_node: u64,
    },
    SnapshotReady {
        daemon_origin: u64,
        snapshot_bytes: Vec<u8>,
        seq_through: u64,
        chunk_index: u32,
        total_chunks: u32,
    },
    RestoreComplete {
        daemon_origin: u64,
        restored_seq: u64,
    },
    ReplayComplete {
        daemon_origin: u64,
        replayed_seq: u64,
        target_head: CausalLink,
    },
    CutoverNotify {
        daemon_origin: u64,
        target_node: u64,
    },
    CleanupComplete {
        daemon_origin: u64,
    },
    MigrationFailed {
        daemon_origin: u64,
        reason: MigrationFailureReason,
    },
    BufferedEvents {
        daemon_origin: u64,
        events: Vec<CausalEvent>,
    },
    ActivateTarget {
        daemon_origin: u64,
    },
    ActivateAck {
        daemon_origin: u64,
        replayed_seq: u64,
    },
}
Expand description

Wire message types for the migration subprotocol (0x0500).

Variants§

§

TakeSnapshot

Phase 0→1: Request snapshot on source.

Fields

§daemon_origin: u64

Origin hash of daemon to migrate.

§target_node: u64

Destination node ID.

§

SnapshotReady

Phase 1→2: Snapshot taken, payload included.

Large snapshots are chunked across multiple SnapshotReady messages. The receiver must reassemble all chunks (0..total_chunks) before deserializing the snapshot. Single-chunk snapshots have chunk_index = 0, total_chunks = 1.

Fields

§daemon_origin: u64

Origin hash of daemon being migrated.

§snapshot_bytes: Vec<u8>

Serialized StateSnapshot bytes (or chunk thereof).

§seq_through: u64

Sequence number the snapshot covers through.

§chunk_index: u32

Zero-based index of this chunk.

§total_chunks: u32

Total number of chunks for this snapshot.

§

RestoreComplete

Phase 2→3: Target restored daemon from snapshot.

Fields

§daemon_origin: u64

Origin hash of daemon being migrated.

§restored_seq: u64

Sequence number restored through.

§

ReplayComplete

Phase 3→4: Target finished replaying buffered events.

Fields

§daemon_origin: u64

Origin hash of daemon being migrated.

§replayed_seq: u64

Sequence number replayed through.

§target_head: CausalLink

Target’s chain head after replay. The orchestrator stamps this into its SuperpositionState so continuity proofs carry the real cryptographic anchor even when the orchestrator lives on a third node and has no local daemon registry entry to read from.

§

CutoverNotify

Phase 4: Source stops accepting writes, routing switches.

Fields

§daemon_origin: u64

Origin hash of daemon being migrated.

§target_node: u64

Target node that is now authoritative.

§

CleanupComplete

Phase 5: Source cleaned up.

Fields

§daemon_origin: u64

Origin hash of daemon whose migration is complete.

§

MigrationFailed

Any phase: Abort migration.

Fields

§daemon_origin: u64

Origin hash of daemon whose migration failed.

§reason: MigrationFailureReason

Structured reason code — source dispatches on this to decide whether the migration is retriable. See MigrationFailureReason.

§

BufferedEvents

Buffered events from source for replay on target.

Fields

§daemon_origin: u64

Origin hash of daemon being migrated.

§events: Vec<CausalEvent>

Events to replay, in causal order.

§

ActivateTarget

Phase 5→6: Source has cleaned up; target should now go live.

Emitted by the orchestrator once it observes CleanupComplete. The target calls MigrationTargetHandler::activate in response and replies with ActivateAck.

Fields

§daemon_origin: u64

Origin hash of daemon whose target should activate.

§

ActivateAck

Phase 6: Target has activated and is now authoritative.

Fields

§daemon_origin: u64

Origin hash of daemon whose migration is complete.

§replayed_seq: u64

Sequence number the target is authoritative through.

Trait Implementations§

Source§

impl Clone for MigrationMessage

Source§

fn clone(&self) -> MigrationMessage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MigrationMessage

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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