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

KV Read-after-Write Consistency #6557

Open
ripienaar opened this issue Feb 21, 2025 · 1 comment
Open

KV Read-after-Write Consistency #6557

ripienaar opened this issue Feb 21, 2025 · 1 comment
Labels
2.12 accepted The defect or proposal as been accepted needs design Needs design or ADR needs info Additional info is needed proposal Enhancement idea or proposal

Comments

@ripienaar
Copy link
Contributor

Proposed change

Since introducing Direct Get we lost our, admittedly imperfect, read-after-write consistency in KV stores.

We felt then that was an acceptable behaviour change but its clear that there are significant need for control in this area.

We might still default to the current behaviour but should at least provide a opt-in to be in-cluster consistent and in-supercluster eventually consistent.

This can take a few forms:

  • We can add a leader-only direct get subject
  • We can adopt some of the thoughts @MauriceVanVeen has around improving the consistency of the raft layer

Even if we do nothing, we should very clearly and prominently document what we do and do not support in places other than the ADR.

Use case

Increase the areas KV is applicable

Contribution

No response

@ripienaar ripienaar added 2.12 accepted The defect or proposal as been accepted needs design Needs design or ADR needs info Additional info is needed proposal Enhancement idea or proposal labels Feb 21, 2025
@MauriceVanVeen
Copy link
Member

We can add a leader-only direct get subject

If we'd be able to only get a response from a leader, we'd still not be able to guarantee read-after-write.
Without leader changes it'd work, but during every leader change there's a chance you get stale reads. Also if the current leader is network partitioned, and you write using a different connection to the new leader, you'd also get stale reads from the old (partitioned) leader.

There are a number of options to be able to guarantee this, even without requiring you to always connect directly to the leader. @mprimi has some thoughts about that as well, allowing replicas to answer if they can guarantee your read-after-write (with of course other tradeoffs as well).

Using the same connection object to guarantee read-after-writes sounds okay, but likely turns out to be brittle. Instead we should probably go for an implementation where we can strictly guarantee this. Regardless of if only the leader answers, or replicas can also answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.12 accepted The defect or proposal as been accepted needs design Needs design or ADR needs info Additional info is needed proposal Enhancement idea or proposal
Projects
None yet
Development

No branches or pull requests

2 participants