-
Notifications
You must be signed in to change notification settings - Fork 400
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
progress.committed_index may not accurate and progress.matched >= progress.committed_index may broken #426
Comments
Case 1 is expected. Case 2 can happen. How about only updating Why 3 is possible? If there is leadership change, |
Another possible case is |
Looks good to me. |
I think maybe we don't need to maintain this invariant. Though it may make users a little bit confused. |
We use
progress.committed_index
to keep track of a peer's known commit index, but in some casesprogress.committed_index
may not accurate andprogress.matched >= progress.committed_index
may not be true, althoughraft-rs
not rely on this assumption directly, it is pretty intuitive and can be misused by the user.Here are some cases I found:
prs
, but only resetpr.matched = 0
notpr.committed_index
pr.matched
update inon_persist_entries
, if a raft log committed before the leader persist it (ormaybe_persist
returnfalse
), the leader'spr.matched
may less than itspr.committed_index
pr.matched
andpr.committed_index
inhandle_append_response
, but ifresp.reject
is true, the leader only update thepr.committed_index
The text was updated successfully, but these errors were encountered: