From f063ebfad28522b3c5ce658ea7910f8772db242a Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Tue, 12 May 2015 13:54:44 -0700 Subject: [PATCH] Default Raft election timeout to 5 seconds --- CHANGELOG.md | 1 + etc/config.sample.toml | 2 +- raft/clock.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae77d927b46..3584abb32c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This release has a breaking API change for writes -- the field previously called - [#2525](https://github.com/influxdb/influxdb/pull/2525): Serve broker diagnostics over HTTP - [#2186](https://github.com/influxdb/influxdb/pull/2186): The default status code for queries is now `200 OK` - [#2298](https://github.com/influxdb/influxdb/pull/2298): Successful writes now return a status code of `204 No Content` - thanks @neonstalwart! +- [#2549](https://github.com/influxdb/influxdb/pull/2549): Raft election timeout to 5 seconds, so system is more forgiving of CPU loads. ### Bugfixes - [#2535](https://github.com/influxdb/influxdb/pull/2535): Return exit status 0 if influxd already running. Thanks @haim0n. diff --git a/etc/config.sample.toml b/etc/config.sample.toml index 40d1304b9cb..12bd5a99842 100644 --- a/etc/config.sample.toml +++ b/etc/config.sample.toml @@ -83,7 +83,7 @@ max-segment-size = 10485760 # Raft configuration. Controls the distributed consensus system. [raft] apply-interval = "10ms" -election-timeout = "1s" +election-timeout = "5s" heartbeat-interval = "100ms" reconnect-timeout = "10ms" diff --git a/raft/clock.go b/raft/clock.go index 9b203c6f158..6e5a48e9b9f 100644 --- a/raft/clock.go +++ b/raft/clock.go @@ -10,7 +10,7 @@ const ( DefaultApplyInterval = 10 * time.Millisecond // DefaultElectionTimeout is the default time before starting an election. - DefaultElectionTimeout = 1 * time.Second + DefaultElectionTimeout = 5 * time.Second // DefaultHeartbeatInterval is the default time to wait between heartbeats. DefaultHeartbeatInterval = 100 * time.Millisecond