pub struct CrossClusterSnapshotEnvelope {
pub source_cluster_id: String,
pub source_database_id: String,
pub snapshot_lsn: u64,
pub total_bytes: u64,
pub total_crc32c: u32,
pub offset: u64,
pub data: Vec<u8>,
pub done: bool,
}Expand description
Wire envelope that wraps a cross-cluster snapshot chunk.
Encoded with zerompk (MessagePack) and placed in the data field of the
existing nodedb_raft::InstallSnapshotRequest. The in-cluster Raft
machinery transfers the bytes unchanged; the mirror receiver unwraps this
envelope.
§Integrity
total_crc32c is the CRC32C of the entire snapshot payload (concatenation
of every chunk’s data in offset order). The source computes it once over
the snapshot file and stamps the same value into every envelope of the
transfer. The receiver maintains a running CRC32C as chunks arrive and
validates it against total_crc32c when done = true; mismatch raises
super::super::error::MirrorError::SnapshotCrcMismatch and the partial
file is discarded.
Fields§
§source_cluster_id: StringCluster-id of the source cluster that produced this snapshot.
source_database_id: StringDatabase id on the source cluster being mirrored.
snapshot_lsn: u64WAL LSN at which this snapshot was taken. After the snapshot is
fully applied the mirror sets last_applied to this value and
begins streaming AppendEntries from snapshot_lsn + 1.
total_bytes: u64Total snapshot size in bytes (same value in every chunk of the same snapshot transfer).
total_crc32c: u32CRC32C over the entire snapshot payload (same value in every chunk of the same snapshot transfer). Validated by the receiver on the final chunk.
offset: u64Byte offset within the snapshot for this chunk.
data: Vec<u8>Chunk payload bytes.
done: boolTrue on the final chunk.
Trait Implementations§
Source§impl Clone for CrossClusterSnapshotEnvelope
impl Clone for CrossClusterSnapshotEnvelope
Source§fn clone(&self) -> CrossClusterSnapshotEnvelope
fn clone(&self) -> CrossClusterSnapshotEnvelope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CrossClusterSnapshotEnvelope
impl Debug for CrossClusterSnapshotEnvelope
Source§impl<'de> Deserialize<'de> for CrossClusterSnapshotEnvelope
impl<'de> Deserialize<'de> for CrossClusterSnapshotEnvelope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CrossClusterSnapshotEnvelope
impl PartialEq for CrossClusterSnapshotEnvelope
Source§fn eq(&self, other: &CrossClusterSnapshotEnvelope) -> bool
fn eq(&self, other: &CrossClusterSnapshotEnvelope) -> bool
self and other values to be equal, and is used by ==.impl Eq for CrossClusterSnapshotEnvelope
impl StructuralPartialEq for CrossClusterSnapshotEnvelope
Auto Trait Implementations§
impl Freeze for CrossClusterSnapshotEnvelope
impl RefUnwindSafe for CrossClusterSnapshotEnvelope
impl Send for CrossClusterSnapshotEnvelope
impl Sync for CrossClusterSnapshotEnvelope
impl Unpin for CrossClusterSnapshotEnvelope
impl UnsafeUnpin for CrossClusterSnapshotEnvelope
impl UnwindSafe for CrossClusterSnapshotEnvelope
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.