Skip to content

Linearizable reads/writes #1344

@srh

Description

@srh

(We didn't have an issue for this.) The feature we want is for read behavior to be linearizable, instead of happily reading outdated data.

The short of it is, we're going to use etcd/raft's ReadIndex functionality. To avoid spamming Raft groups' leaders with MsgReadIndex messages, each follower node will only make one in-flight request at a time. We'll do this from whatever node serves our Raft group.

That's the most basic version -- we could get more clever about how we do ReadIndex in the future to reduce latency. We could allow multiple in-flight requests (and take care not to let them bunch up).
We could send our requests from other machines to avoid extra network hops. Some descriptions of alternatives are here: https://discuss.dgraph.io/t/linearizability/1683/3

We will also need to change the watermark implementation to not use sleep.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions