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

Linearizable read with ReadIndex #965

Closed
Tracked by #806
drmingdrmer opened this issue Dec 8, 2023 · 1 comment · Fixed by #964
Closed
Tracked by #806

Linearizable read with ReadIndex #965

drmingdrmer opened this issue Dec 8, 2023 · 1 comment · Fixed by #964

Comments

@drmingdrmer
Copy link
Member

drmingdrmer commented Dec 8, 2023

Obtains a ReadIndex from RaftCore if it remains the leader, and blocks until the state machine applies up to the ReadIndex. This process ensures that the application observes all state visible to a preceding read operation.

Copy link

github-actions bot commented Dec 8, 2023

👋 Thanks for opening this issue!

Get help or engage by:

  • /help : to print help messages.
  • /assignme : to assign this issue to you.

drmingdrmer added a commit to drmingdrmer/openraft that referenced this issue Dec 8, 2023
The `Raft::is_leader()` method does not fully ensure linearizable read
operations and is deprecated in this version. Instead, applications
should use the `Raft::ensure_linearizable()` method to guarantee
linearizability.

Under the hood, `Raft::ensure_linearizable()` obtains a `ReadIndex` from
`RaftCore` if it remains the leader, and blocks until the state
machine applies up to the `ReadIndex`. This process ensures that the
application observes all state visible to a preceding read operation.

- Fix: databendlabs#965

Upgrade tip:

Replace `Raft::is_leader()` with `Raft::ensure_linearizable()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant