Skip to content
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

Closed
andreev-io opened this issue Aug 18, 2021 · 4 comments
Closed

Add Abandoned type to TransitionState enum #13

andreev-io opened this issue Aug 18, 2021 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@andreev-io
Copy link
Owner

andreev-io commented Aug 18, 2021

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 the Queued -> 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 the TransitionState enum. We could also have that Abandoned state wrap around another type so that we could signal the particular reason why a transition has been abandoned -- NotLeader vs UncommittedUnsynced. Naming could be improved.

@andreev-io andreev-io changed the title Add abandoned type to TransitionState enum Add Abandoned type to TransitionState enum Aug 21, 2021
@andreev-io andreev-io added enhancement New feature or request good first issue Good for newcomers labels Aug 21, 2021
@andreev-io andreev-io added this to the Production grade milestone Aug 21, 2021
@paulhenri
Copy link

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.
Is there a desired deadline for this issue ?

@andreev-io
Copy link
Owner Author

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.

@andreev-io
Copy link
Owner Author

@paulhenri Want me to assign this to you?

@paulhenri
Copy link

paulhenri commented Aug 28, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants