-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add Abandoned type to TransitionState enum #13
Comments
Hello, I would like to give it a go - But i must warn you thaht i'm more on the beginner side when it comes to Rust. |
Hey @paulhenri! There's no deadline. Please do give this a go -- I think you should be just fine as a newcomer, and if something is hard to understand, let's talk about it so that I can add more comments to Little Raft code. |
@paulhenri Want me to assign this to you? |
Yes please :)
Le sam. 28 août 2021 à 11:05, Ilya Andreev ***@***.***> a
écrit :
… @paulhenri <https://github.com/paulhenri> Want me to assign this to you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADIE2FFRBPMOMT6P4SIWKTT7CRHDANCNFSM5CM43XXA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Raft is an asynchronous protocol, so one of the challenges when using it is getting feedback on whether a particular transition has or hasn't been applied. To solve this problem, Little Raft calls the user-defined
register_transition_state
hook every time any transition changes its state. This way the library user can keep track of transitions as they move through theQueued -> Committed -> Applied
pipeline.However, a transition could be ignored by the replica it has been submitted to. The most likely reason for that is because the replica is not the cluster leader. Another possible reason is that the replica used to be the leader, then got disconnected from the rest of the cluster, kept accepting transitions for processing for a while and then had to drop them when connecting back to the cluster that in the meanwhile elected another, newer leader (the stale leader dropping uncommitted transitions is the desired behavior in this case).
To let the user know when a transition got dropped, we should add
Abandoned
state to theTransitionState
enum. We could also have thatAbandoned
state wrap around another type so that we could signal the particular reason why a transition has been abandoned --NotLeader
vsUncommittedUnsynced
. Naming could be improved.The text was updated successfully, but these errors were encountered: