-
Notifications
You must be signed in to change notification settings - Fork 0
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
[WIP] add mayPromote check #19
Conversation
Some thoughts:
Looks like we need to check if member exist, if member is learner and its progress before sending the request to raft. This will cause race, and maybe we will have to live with it. I do not think we can do the progress check in apply stage, because A) only leader has the information, and B) whether or not a config change is applied should NOT depend on storage state.
Conceptually we want to compare learner's committed index with leader's committed index. Learner's committed index is basically the Line 1723 in f29b1ad
|
@jingyih I talked with xiang90 about our questions. He said ok about this implementation now.Below is update: 2 we can have a seperate pr for the |
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.
Thanks for the new changes! Given that etcd only allows one pending config change at a time, I think in most cases this will be fine.
Let's also add some helper function on client side to find leader before sending the promote request. Do you want me to work on this? |
How about client loop through all the endpoints and retry until we find a endpoint that do not return |
Correct me if I am wrong:
Ref: etcd/etcdserver/api/v3rpc/interceptor.go Line 45 in 066ae1d
|
hmm... you plan to do it on the server side ? |
I do not have a full solution yet. I am think about fixing |
BTW, with this change, we should also update |
fa08273
to
7e0f2be
Compare
@jingyih changed, ptal. |
1a9ebf9
to
43d85f8
Compare
@jpbetz Could you also take a look? |
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.
I think this is almost ready to merge. Once this is merged, I will merge #31. Then we completed the solution for learner progress check.
@jingyih a integration test failed
|
It is a flaky test, unrelated to this PR. See etcd-io#10700 for reference. |
@jingyih I plan to merge this and add more test in next pr. WDYT |
On second thought, we must figure out how to fake the |
Merging this PR. We'll figure out how to fake raftStatus() in server unit test later. |
Below is a WIP
mayPromote
check. It now compares leader'sMatch
and learner'sMatch
to see if learner has caught with the leader. It implements the design now, but it may have some flaws:1 Since we plan to do
mayPromote
check in etcdserver, so it needs the id exists in the cluster, but we check if member which user provides exists later in the validation apply phase. Ideally it should check member if exists, then if member is a learner, finally check if it is ready. But the order now is wrong.2
IsReadyToPromoteMember
borrows idea fromIsReadyToAddMember
. Do we need more check?3 Does check
Match
ok?Looking for your suggestion @jingyih @xiang90