-
Notifications
You must be signed in to change notification settings - Fork 166
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 MsgVote 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
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters