Skip to content

Commit

Permalink
raft: increase heartbeat interval
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgrinaker committed Jun 9, 2024
1 parent 952d8b1 commit 2cfaa8d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/raft/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ pub use message::{Envelope, Message, ReadSequence, Request, RequestID, Response,
pub use node::{Node, NodeID, Options, Term, Ticks};
pub use state::State;

/// The interval between Raft ticks. This is the unit of time for heartbeats and
/// elections.
/// The interval between Raft ticks, the unit of time.
pub const TICK_INTERVAL: std::time::Duration = std::time::Duration::from_millis(100);

/// The interval between leader heartbeats, in ticks.
const HEARTBEAT_INTERVAL: Ticks = 3;
/// The interval between leader heartbeats in ticks.
const HEARTBEAT_INTERVAL: Ticks = 4;

/// The default election timeout range, in ticks. This is randomized in this
/// The default election timeout range in ticks. This is randomized in this
/// interval, to avoid election ties.
const ELECTION_TIMEOUT_RANGE: std::ops::Range<Ticks> = 10..20;

Expand Down

0 comments on commit 2cfaa8d

Please sign in to comment.