You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 :
The leader should extend its lease when a log is accepted by a quorum.
and add a public API such as Raft::read(sm: &mut impl RaftStateMachine) that atomically checks leader lease and reads some data from the state machine.
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: