Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
Post-Helium
-
None
-
None
-
Operating System: All
Platform: All
-
2773
-
Normal
Description
The election timeout is calculated by multiplying the heartbeat interval by the election timeout factor. We're changing the default election timeout factor to 20 and keeping the heartbeat time out at 500 ms which means the election timeout will be 10 sec. This will alleviate/reduce spurious elections due to latencies and GC but will increase the time on startup in a single node cluster when it declares itself the leader. Currently it initializes to follower hoping to hear from a leader. If the election timeout occurs it goes to candidate to start a new election. If the candidate times out due to no peer response, if there's no peers configured it becomes the leader. So in single-node this will now take 20 sec before. However, since there's no peers configured, we know the follower and candidate stages will time out so we might as well initialize right to leader and avoid the time outs.