Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not reset the electionElapsed if the node doesn't grant vote
If the local node receives a message with higher term, but it doesn't grant the vote; it turns into a follower, but it shouldn't reset the electionElapsed, to ensure it has higher priority to start a campaign in the next round of election. If we reject a node, it's highly likely we will reject it again if it immediately campaigns again. So it may waste a long time to elect a leader if we reset the electionElapsed. Signed-off-by: Benjamin Wang <[email protected]>
- Loading branch information