#[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: u64Serving primary’s applied frontier (commit_min) when the descriptor
was built. The receiver’s tail repair targets past this.
group: u64§available: u8Set 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: u64Serving 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
impl CheckedBitPattern for StateTransferTargetHeader
Source§type Bits = StateTransferTargetHeaderBits
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
fn is_valid_bit_pattern(bits: &StateTransferTargetHeaderBits) -> bool
bits
as &Self.Source§impl Clone for StateTransferTargetHeader
impl Clone for StateTransferTargetHeader
Source§fn clone(&self) -> StateTransferTargetHeader
fn clone(&self) -> StateTransferTargetHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ConsensusHeader for StateTransferTargetHeader
impl ConsensusHeader for StateTransferTargetHeader
Source§const FRAME_SEALED: bool = true
const FRAME_SEALED: bool = true
checksum field seals the frame. Read moreconst COMMAND: Command = Command::StateTransferTarget
Source§fn set_checksum(&mut self, checksum: u128)
fn set_checksum(&mut self, checksum: u128)
checksum field.fn operation(&self) -> Operation
fn command(&self) -> Command
fn size(&self) -> u32
Source§const IDENTITY_CHECKSUMMED: bool = false
const IDENTITY_CHECKSUMMED: bool = false
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
const OPERATION_OFFSET: Option<usize> = None
Source§fn accepts(command: Command) -> bool
fn accepts(command: Command) -> bool
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
fn frame_checksum(&self) -> u128
checksum itself. Read moreSource§fn seal(&mut self)
fn seal(&mut self)
Self::frame_checksum. Call last when building a frame: it covers
every other field, checksum_body included, so later writes are uncovered.