Skip to content

Commit

Permalink
Fix Raft heartbeat rate for Zero. (#3753)
Browse files Browse the repository at this point in the history
In #3708 (4b41d9c) we bumped up the Raft
heartbeat rate to 100ms ticks. This change also updates the heartbeat ticker for
Zero too. Otherwise, Zero's election ticker would happen every 400ms instead of
every 2s since raft.Config.ElectionTick is set to 20.
  • Loading branch information
danielmai authored Aug 6, 2019
1 parent 58820c0 commit 9abaea4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dgraph/cmd/zero/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ func (n *node) trySnapshot(skip uint64) {

func (n *node) Run() {
var leader bool
ticker := time.NewTicker(20 * time.Millisecond)
ticker := time.NewTicker(100 * time.Millisecond)
defer ticker.Stop()

// snapshot can cause select loop to block while deleting entries, so run
Expand Down

0 comments on commit 9abaea4

Please sign in to comment.