struct

Raft::Config

Inherits Struct < Value < Object

Configuration parameters for a Raft node.

All timeout values are in milliseconds. Sensible defaults are provided for production use. For testing, use shorter timeouts (e.g., 50-100ms election timeout, 25ms heartbeat).

Constructors

Instance methods

active_passive?

Enable active-passive mode for 2-node clusters. Lowers quorum to 1 so either node can elect itself and accept writes when the other is down.

WARNING: This sacrifices consistency for availability. During a network partition both nodes may accept writes independently. When the partition heals, the node with the lower term loses its divergent entries via normal Raft log conflict resolution. Only use when availability is more important than strict consistency.

Source
election_timeout_max

Maximum election timeout in milliseconds.

Source
election_timeout_max=(election_timeout_max : Int32)

Maximum election timeout in milliseconds.

Source
election_timeout_min

Minimum election timeout in milliseconds. A follower that receives no heartbeat within a random duration between this and election_timeout_max will start a pre-vote round.

Source
election_timeout_min=(election_timeout_min : Int32)

Minimum election timeout in milliseconds. A follower that receives no heartbeat within a random duration between this and election_timeout_max will start a pre-vote round.

Source
heartbeat_interval

Heartbeat interval in milliseconds. The leader sends heartbeats to followers at this interval to maintain authority. Should be significantly less than the election timeout.

Source
heartbeat_interval=(heartbeat_interval : Int32)

Heartbeat interval in milliseconds. The leader sends heartbeats to followers at this interval to maintain authority. Should be significantly less than the election timeout.

Source
max_entries_per_rpc

Maximum number of log entries to include in a single AppendEntries RPC.

Source
max_entries_per_rpc=(max_entries_per_rpc : Int32)

Maximum number of log entries to include in a single AppendEntries RPC.

Source
max_inflight_rpcs

Maximum number of in-flight AppendEntries RPCs per replicator (pipeline depth). Higher values improve throughput when network RTT is the bottleneck by overlapping consecutive batches. Set to 1 to disable pipelining and match pre-pipeline behaviour.

Source
max_inflight_rpcs=(max_inflight_rpcs : Int32)

Maximum number of in-flight AppendEntries RPCs per replicator (pipeline depth). Higher values improve throughput when network RTT is the bottleneck by overlapping consecutive batches. Set to 1 to disable pipelining and match pre-pipeline behaviour.

Source
rtt_probe_interval

Interval in seconds between RTT measurement probes. Default: 60.

Source
rtt_probe_interval=(rtt_probe_interval : Int32)

Interval in seconds between RTT measurement probes. Default: 60.

Source
rtt_tuning?

Enable automatic RTT-based timeout tuning. When enabled, the node periodically measures round-trip time to peers and adjusts heartbeat and election timeouts following etcd best practices.

Source
snapshot_chunk_size

Maximum size in bytes of each snapshot chunk sent via InstallSnapshot RPC.

Source
snapshot_chunk_size=(snapshot_chunk_size : Int32)

Maximum size in bytes of each snapshot chunk sent via InstallSnapshot RPC.

Source
snapshot_threshold

Number of applied entries since the last snapshot before automatically triggering a new snapshot. Set to 0 to disable auto-snapshots.

Source
snapshot_threshold=(snapshot_threshold : Int32)

Number of applied entries since the last snapshot before automatically triggering a new snapshot. Set to 0 to disable auto-snapshots.

Source