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 check for Consistent read #2

Closed
maximecaron opened this issue Mar 31, 2016 · 2 comments
Closed

Add check for Consistent read #2

maximecaron opened this issue Mar 31, 2016 · 2 comments

Comments

@maximecaron
Copy link

In order to have consistent read, read request need to be forwarded to leader node.
Also leader node need to verify it is still the leader using the code below.

if err := raft.VerifyLeader().Error(); err != nil {
return err
}

@michaelbironneau
Copy link
Owner

You're right. Going forward I'll make the read consistency configurable along the same lines as suggested in the OP on a similar issue in etcd (see here). This will mean that the user can opt for consistent reads or potentially stale reads.

@michaelbironneau
Copy link
Owner

Resolved by db4aec0. The leader now verifies that it is still the leader before accepting any writes and reads now have three consistency options: "Any" (potentially stale but faster), "Leader" (no network round trip done to verify it is still leader) and "Consistent", which means that the read is done via Raft leader which checks it is still the leader before replying.

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

No branches or pull requests

2 participants