-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Fix quorum calculation when promoting a learner member #11640
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11640 +/- ##
==========================================
- Coverage 66.28% 66% -0.28%
==========================================
Files 401 401
Lines 36629 36629
==========================================
- Hits 24279 24177 -102
- Misses 10861 10940 +79
- Partials 1489 1512 +23
Continue to review full report at Codecov.
|
I went back and forth because on one side I wanted to behave somewhat similar to That's why I decided to instead just count the voting members (instead of |
Regarding tests for promoting a member, we have some integration test cases here [1]. It will be great if you can add any missing test cases. [1] https://github.com/etcd-io/etcd/blob/master/clientv3/integration/cluster_test.go |
When promoting a learner member we should not count already a voting member, but take only into account the number of existing voting members and their current status (started, unstarted) when taking the decision whether a learner member can be promoted. Before this change, it was impossible to grow from a quorum N to a N+1 through promoting a learning member. Fixes: #11633
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
@@ -857,3 +857,90 @@ func TestIsReadyToRemoveVotingMember(t *testing.T) { | |||
} | |||
} | |||
} | |||
|
|||
func TestIsReadyToPromoteMember(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgmt nice job @ereslibre thanks!
…0-upstream-release-3.4 Automated cherry pick of #11640 on release-3.4
When promoting a learner member we should not count already a voting
member, but take only into account the number of existing voting
members and their current status (started, unstarted) when taking the
decision whether a learner member can be promoted.
Before this change, it was impossible to grow from a quorum N to a N+1
through promoting a learning member.
Fixes: #11633
Note: it would be good to add tests to
etcd/etcdserver/server.go
Lines 1490 to 1520 in b64b36a
etcd/etcdserver/server.go
Lines 1522 to 1543 in b64b36a