-
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
How to evaluate learner progress #15
Comments
Regarding the idea of using read index query to get leader's committed index, it is not straightforward to implement. Every Ref: Line 651 in a621d80
Lines 630 to 632 in a621d80
We need something like this:
|
If you have concerns or better ideas, please let me know. Otherwise I will try to come up with a prototype in the next couple days. |
I'm not an expert on this, but what about this one? |
@jingyih I don't know if I explain clearly above, or I can code a prototype. I think my approach is simple and more native than the |
@WIZARD-CXY |
Now that I thought about it. The method I proposed will not work. Because a random node who receives the member promote call does not have info on learner node, nor does it have proper ways to retrieve it. |
So basically a node can either query the progress in raft layer, or in etcdserver layer. If we want the query to happen in etcdserver layer, we need: A) expose progress of leader and learner via |
Talked to @WIZARD-CXY offline, he is going to prototype this. Regarding retrieving information from leader via HTTP, here are some references:
|
Let's start with the first step, which is exposing progress via ready softstate. We can probably avoid the second step which is retrieving info from leader. On client side we may write some helper function to determine the leader endpoint, and only send member promote request to leader. |
good idea |
@jingyih After a closer look, I find sth interesting, check this function |
@jingyih https://github.com/jingyih/etcd/pull/8/files see place where I mentioned you, we can use |
Nice! |
The final design is:
|
Update (5/7/2019): final design #15 (comment)
Let's discuss how to evaluate learner progress before promoting a learner member.
Here is the relevant part from design doc as reference:
So far I have gathered suggestions from @gyuho and @xiang90, but have not yet come up with a complete solution.
Locally, learner knows its own committed index. But it does not have information on leader's raft log(?). So learner needs to query leader in order to understand its 'progress'. Do we need a new raft message type for the query? Maybe use read index query to get leader's committed index and compare it with its own?
After learner finds its 'progress', we can expose it via
Ready.SoftState
so that etcdserver can use it.Please let me know your comments / suggestion.
cc @gyuho @xiang90 @WIZARD-CXY @jpbetz
The text was updated successfully, but these errors were encountered: