pub struct ClusterConfig {Show 13 fields
pub node_id: u64,
pub listen_addr: SocketAddr,
pub seed_nodes: Vec<SocketAddr>,
pub num_groups: u64,
pub replication_factor: usize,
pub data_dir: PathBuf,
pub force_bootstrap: bool,
pub join_retry: JoinRetryPolicy,
pub swim_udp_addr: Option<SocketAddr>,
pub election_timeout_min: Duration,
pub election_timeout_max: Duration,
pub install_snapshot_chunk_bytes: u64,
pub orphan_partial_max_age_secs: u64,
}Expand description
Configuration for cluster formation.
Fields§
§node_id: u64This node’s unique ID.
listen_addr: SocketAddrAddress to listen on for Raft RPCs.
seed_nodes: Vec<SocketAddr>Seed node addresses for bootstrap/join.
num_groups: u64Number of Raft groups to create on bootstrap.
replication_factor: usizeReplication factor (number of replicas per group).
data_dir: PathBufData directory for persistent Raft log storage.
force_bootstrap: boolOperator escape hatch: bypass the probe phase and bootstrap this node unconditionally even if it is not the lexicographically smallest seed.
Set this only on disaster recovery when the designated
bootstrapper is permanently unreachable. Requires listen_addr
to be present in seed_nodes (enforced at the caller’s config
validation layer).
join_retry: JoinRetryPolicyRetry policy for the join loop. Defaults to production values
(8 attempts, 32 s ceiling). Tests override this with a
faster policy.
swim_udp_addr: Option<SocketAddr>Optional UDP bind address for the SWIM failure detector. None
disables SWIM entirely — cluster startup then relies solely on
the existing raft transport for membership observations. When
Some, the operator is expected to spawn SWIM separately via
crate::spawn_swim after the cluster is up and feed the
seed list from seed_nodes.
election_timeout_min: DurationRaft election timeout range. Controls how long a follower waits before starting an election after losing contact with the leader.
election_timeout_max: Duration§install_snapshot_chunk_bytes: u64Maximum byte size of each InstallSnapshot RPC chunk.
Defaults to 4 MiB. Larger values reduce round-trip count at the cost of higher per-RPC memory pressure. Smaller values improve retry granularity for flaky links.
orphan_partial_max_age_secs: u64Age in seconds beyond which a .partial snapshot file is considered
orphaned and can be removed by the GC sweep.
Defaults to 300 s (5 min). A partial file is orphaned when the leader that was sending it has since lost leadership or crashed.
Trait Implementations§
Source§impl Clone for ClusterConfig
impl Clone for ClusterConfig
Source§fn clone(&self) -> ClusterConfig
fn clone(&self) -> ClusterConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ClusterConfig
impl RefUnwindSafe for ClusterConfig
impl Send for ClusterConfig
impl Sync for ClusterConfig
impl Unpin for ClusterConfig
impl UnsafeUnpin for ClusterConfig
impl UnwindSafe for ClusterConfig
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<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.