mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: clarify Heartbeat/ElectionTick comments
Avoid other, ambiguous interpretations.
This commit is contained in:
parent
f0dbd0b856
commit
6c1b3a71db
17
raft/raft.go
17
raft/raft.go
@ -66,15 +66,16 @@ type Config struct {
|
||||
// peer is private and only used for testing right now.
|
||||
peers []uint64
|
||||
|
||||
// ElectionTick is the election timeout. If a follower does not
|
||||
// receive any message from the leader of current term during
|
||||
// ElectionTick, it will become candidate and start an election.
|
||||
// ElectionTick must be greater than HeartbeatTick. We suggest
|
||||
// to use ElectionTick = 10 * HeartbeatTick to avoid unnecessary
|
||||
// leader switching.
|
||||
// ElectionTick is the number of Node.Tick invocations that must pass between
|
||||
// elections. That is, if a follower does not receive any message from the
|
||||
// leader of current term before ElectionTick has elapsed, it will become
|
||||
// candidate and start an election. ElectionTick must be greater than
|
||||
// HeartbeatTick. We suggest ElectionTick = 10 * HeartbeatTick to avoid
|
||||
// unnecessary leader switching.
|
||||
ElectionTick int
|
||||
// HeartbeatTick is the heartbeat interval. A leader sends heartbeat
|
||||
// message to maintain the leadership every heartbeat interval.
|
||||
// HeartbeatTick is the number of Node.Tick invocations that must pass between
|
||||
// heartbeats. That is, a leader sends heartbeat messages to maintain its
|
||||
// leadership every HeartbeatTick ticks.
|
||||
HeartbeatTick int
|
||||
|
||||
// Storage is the storage for raft. raft generates entries and
|
||||
|
Loading…
x
Reference in New Issue
Block a user