Skip to main content

StateTransferTargetHeader

Struct StateTransferTargetHeader 

Source
#[repr(C)]
pub struct StateTransferTargetHeader {
Show 17 fields pub checksum: u128, pub checksum_body: u128, pub cluster: u128, pub size: u32, pub view: u32, pub release: u32, pub command: Command, pub replica: u8, pub reserved_frame: [u8; 66], pub nonce: u128, pub commit_op: u64, pub group: u64, pub available: u8, pub unavailable_transient: u8, pub reserved_alignment: [u8; 6], pub commit_max: u64, pub reserved: [u8; 80],
}
Expand description

The transfer target descriptor.

The artifact list rides the BODY as an encoded state manifest (size spans header + manifest); the header carries only the session nonce and the serving peer’s applied frontier. available == 0 means the serving peer cannot serve right now (not a caught-up primary, or it has never checkpointed, so the requester’s journal repair can cover the whole gap) and the frame is header-only.

Fields§

§checksum: u128§checksum_body: u128§cluster: u128§size: u32§view: u32§release: u32§command: Command§replica: u8§reserved_frame: [u8; 66]§nonce: u128§commit_op: u64

Serving primary’s applied frontier (commit_min) when the descriptor was built. The receiver’s tail repair targets past this.

§group: u64§available: u8§unavailable_transient: u8

Set on an available == 0 refusal that means “not right now” rather than “this node is broken”.

PARTITION arm only: it is the only side with a consecutive-failure count to charge. The requester then re-arms on a flat interval instead of charging that count, whose exponential backoff climbs to 1024x the retry interval and is reset only by a completed install. A serving primary momentarily behind its own frontier is the common case under produce load.

This and commit_max below claim the HEAD of what used to be the reserved tail, so every pre-existing field keeps its published offset. Layout compatibility only: the size assert cannot catch an equal-size reshuffle, so a mid-struct insertion would silently move every field after it. It says nothing about the semantics of these two – an older peer presents zeros here and serves no partition transfers at all.

§reserved_alignment: [u8; 6]

Explicit padding so commit_max sits 8-aligned without the implicit padding NoUninit forbids.

§commit_max: u64

Serving replica’s commit_max when the descriptor was built.

Read by the PARTITION receiver only; the metadata arm branches on available and falls back to journal repair without a refusal.

A partition receiver refuses an offer from a replica that knows LESS than it does: without this the descriptor carried no proof of the sender’s own progress, and a phantom view-0 primary (a group whose directory vanished boots init() rather than init_as_backup(), comes up Normal at view 0, and an empty log is trivially caught up) could hand a data-holding rejoiner an empty offer that unlinks its chain.

§reserved: [u8; 80]

Trait Implementations§

Source§

impl CheckedBitPattern for StateTransferTargetHeader

Source§

type Bits = StateTransferTargetHeaderBits

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
Source§

fn is_valid_bit_pattern(bits: &StateTransferTargetHeaderBits) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
Source§

impl Clone for StateTransferTargetHeader

Source§

fn clone(&self) -> StateTransferTargetHeader

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 ConsensusHeader for StateTransferTargetHeader

Source§

const FRAME_SEALED: bool = true

Whether this header’s checksum field seals the frame. Read more
Source§

const COMMAND: Command = Command::StateTransferTarget

Source§

fn checksum(&self) -> u128

The checksum field, whatever this header spends it on.
Source§

fn set_checksum(&mut self, checksum: u128)

Overwrite the checksum field.
Source§

fn operation(&self) -> Operation

Source§

fn command(&self) -> Command

Source§

fn size(&self) -> u32

Source§

fn validate(&self) -> Result<(), ConsensusError>

Errors Read more
Source§

const IDENTITY_CHECKSUMMED: bool = false

Whether checksum carries the prepare identity, which covers the operation byte: an unknown operation on such a frame can be authenticated from the raw bytes even though the typed view refuses to cast. False wherever checksum seals the frame or crosses the client boundary.
Source§

const OPERATION_OFFSET: Option<usize> = None

Byte offset of this header’s operation field, None when it carries none. Read more
Source§

fn accepts(command: Command) -> bool

Whether a frame carrying command may be typed as this header. Defaults to an exact match; a header that serves several commands with one layout (e.g. RepairDone / RangeEvicted) widens it.
Source§

fn frame_checksum(&self) -> u128

Checksum over every byte of the header past checksum itself. Read more
Source§

fn seal(&mut self)

Stamp Self::frame_checksum. Call last when building a frame: it covers every other field, checksum_body included, so later writes are uncovered.
Source§

fn verify_frame(&self) -> Result<(), ConsensusError>

Reject a frame whose header does not match its own checksum. Read more
Source§

impl Copy for StateTransferTargetHeader

Source§

impl Debug for StateTransferTargetHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for StateTransferTargetHeader

Source§

impl NoUninit for StateTransferTargetHeader

Source§

impl PartialEq for StateTransferTargetHeader

Source§

fn eq(&self, other: &StateTransferTargetHeader) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StateTransferTargetHeader

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, 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> 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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.