-
Notifications
You must be signed in to change notification settings - Fork 155
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
Support consistent read with leader lease #804
Comments
👋 Thanks for opening this issue! Get help or engage by:
|
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Openraft has a mechanism called leader lease. This mechanism ensures that a follower does not elect itself as a leader before a certain period of time, which is determined by adding the
timer_config.leader_lease + timer_config.election_timeout
. The follower refreshes the lease by updating the last-updated-time of the vote. However, the current issue is that the leader does not update the lease yet.To support reading consistent state, openraft needs to :
Raft::read(sm: &mut impl RaftStateMachine)
that atomically checks leader lease and reads some data from the state machine.https://github.com/datafuselabs/openraft/blob/54154202beec3e2de433044baae505cc80db375b/openraft/src/core/raft_core.rs#L1345-L1357
https://github.com/datafuselabs/openraft/blob/54154202beec3e2de433044baae505cc80db375b/openraft/src/engine/handler/vote_handler/mod.rs#L124
Originally posted by @drmingdrmer in #262 (comment)
The text was updated successfully, but these errors were encountered: