-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: configure Raft Pre-Vote to reduce disruptive rejoining servers #9352
Merged
Conversation
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
gyuho
changed the title
*: configure Rat Pre-Vote to reduce disruptive rejoining servers
*: configure Raft Pre-Vote to reduce disruptive rejoining servers
Feb 23, 2018
gyuho
force-pushed
the
raft-pre-vote
branch
2 times, most recently
from
February 25, 2018 19:10
2ae5b2a
to
08f3072
Compare
@xiang90 Will investigate more based on the server logs. |
Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #9352 +/- ##
=========================================
- Coverage 72.54% 72.44% -0.1%
=========================================
Files 362 362
Lines 30783 30793 +10
=========================================
- Hits 22330 22309 -21
- Misses 6826 6855 +29
- Partials 1627 1629 +2
Continue to review full report at Codecov.
|
july2993
added a commit
to july2993/raft-rs
that referenced
this pull request
Mar 12, 2018
BusyJay
pushed a commit
to tikv/raft-rs
that referenced
this pull request
Mar 23, 2018
shbieng
pushed a commit
to shbieng/raft-rs
that referenced
this pull request
Sep 19, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Address #9333 and #8499.
/cc @wojtek-t @jpbetz
In simplest form, Raft leader steps down to follower when it receives a message with higher term. For instance, a flaky(or rejoining) member drops in and out, and starts campaign. This member will end up with a higher term, and ignore all incoming messages with lower term. In this case, a new leader eventually need to get elected, thus disruptive to cluster availability. Same happens with isolated member or slow incoming network. In etcd, isolated member with higher term would send
pb.MsgAppResp
, in response topb.MsgHeartbeat
from leader, andpb.MsgAppResp
to leader forces leader to step down, and cluster becomes unavailable.Raft implements Pre-Vote phase to prevent this kind of disruptions. If enabled, Raft runs an additional phase of election to check if pre-candidate can get enough votes to win an election. If not, it would remain as follower, and most likely, receive leader heartbeats to reset its elapsed election ticks.
Pre-Vote feature is recommended in deployments that would require higher availability, at the cost of more expensive election protocols. Thus, it's added as an experimental feature. Will be enabled by default in 3.5.
Added tests in Raft package, but not in etcd server layer, since
CheckQuorum
is true by default for etcd, hard to test this Raft logic in server-side.We can add more tests around this once we refactor integration package with embedded etcd and proxy layer.
/cc @bdarnell @siddontang for Raft tests.