pub struct RaftConfig {Show 17 fields
pub replication: ReplicationConfig,
pub batching: BatchingConfig,
pub election: ElectionConfig,
pub membership: MembershipConfig,
pub state_machine: StateMachineConfig,
pub snapshot: SnapshotConfig,
pub persistence: PersistenceConfig,
pub learner_catchup_threshold: u64,
pub learner_check_throttle_ms: u64,
pub general_raft_timeout_duration_in_ms: u64,
pub snapshot_rpc_timeout_ms: u64,
pub auto_join: AutoJoinConfig,
pub read_consistency: ReadConsistencyConfig,
pub backpressure: BackpressureConfig,
pub rpc_compression: RpcCompressionConfig,
pub watch: WatchConfig,
pub metrics: MetricsConfig,
}Expand description
Configuration parameters for the Raft consensus algorithm implementation
Fields§
§replication: ReplicationConfigConfiguration settings related to log replication Includes parameters like heartbeat interval and AppendEntries entry count limit
batching: BatchingConfigClient request batching configuration
Controls flush thresholds for the leader’s propose and linearizable-read buffers. Separate from replication config — this governs the client ingestion layer, not the Leader→Follower replication path.
election: ElectionConfigConfiguration settings for leader election mechanism Controls timeouts and randomization factors for election timing
membership: MembershipConfigConfiguration settings for cluster membership changes Handles joint consensus transitions and cluster reconfiguration rules
state_machine: StateMachineConfigConfiguration settings for state machine behavior
Controls state machine operations like lease management, compaction, etc.
For backward compatibility, can also be configured via storage in TOML files.
snapshot: SnapshotConfigConfiguration settings for snapshot feature
persistence: PersistenceConfigConfiguration settings for log persistence behavior Controls how and when log entries are persisted to stable storage
learner_catchup_threshold: u64Maximum allowed log entry gap between leader and learner nodes Learners with larger gaps than this value will trigger catch-up replication Default value is set via default_learner_catchup_threshold() function
learner_check_throttle_ms: u64Throttle interval (milliseconds) for learner progress checks Prevents excessive checking of learner promotion eligibility Default value is set via default_learner_check_throttle_ms() function
general_raft_timeout_duration_in_ms: u64Base timeout duration (in milliseconds) for general Raft operations Used as fallback timeout when operation-specific timeouts are not set Default value is set via default_general_timeout() function
snapshot_rpc_timeout_ms: u64Timeout for snapshot RPC operations (milliseconds)
auto_join: AutoJoinConfigConfiguration settings for new node auto join feature
read_consistency: ReadConsistencyConfigConfiguration for read operation consistency behavior Controls the trade-off between read performance and consistency guarantees
backpressure: BackpressureConfigBackpressure configuration for client request flow control Prevents unbounded memory growth by rejecting excess requests
rpc_compression: RpcCompressionConfigRPC compression configuration for different service types
Controls which RPC service types use response compression. Allows fine-tuning for performance optimization based on deployment environment and traffic patterns.
watch: WatchConfigConfiguration for Watch mechanism that monitors key changes Controls event queue sizes and metrics behavior
metrics: MetricsConfigPerformance metrics configuration Controls metrics emission and sampling for observability vs performance trade-off
Implementations§
Trait Implementations§
Source§impl Clone for RaftConfig
impl Clone for RaftConfig
Source§fn clone(&self) -> RaftConfig
fn clone(&self) -> RaftConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RaftConfig
impl Debug for RaftConfig
Source§impl Default for RaftConfig
impl Default for RaftConfig
Source§impl<'de> Deserialize<'de> for RaftConfig
impl<'de> Deserialize<'de> for RaftConfig
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>,
Auto Trait Implementations§
impl Freeze for RaftConfig
impl RefUnwindSafe for RaftConfig
impl Send for RaftConfig
impl Sync for RaftConfig
impl Unpin for RaftConfig
impl UnsafeUnpin for RaftConfig
impl UnwindSafe for RaftConfig
Blanket Implementations§
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request