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

Local reader #17

Merged
merged 13 commits into from
May 31, 2021
Prev Previous commit
Next Next commit
Address comments
Signed-off-by: Neil Shen <[email protected]>
  • Loading branch information
overvenus committed Nov 29, 2018
commit 3deaab96bdb55763abd60cfe0f7432e84c0973c9
10 changes: 6 additions & 4 deletions text/2018-01-03-local-reader.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ linearizability.
## Local reader

The local reader uses ReadDelegates (delegate) to handle requests. Every
Hoverbear marked this conversation as resolved.
Show resolved Hide resolved
delegate is owned by a Raft peer which belongs to the raftstore, they
communicate via a channel, and each pair of them shares an atomic `LeaderLease`.
delegate is owned by a Raft peer which belongs to the raftstore. The delegate
and the peer communicate via a channel, and each pair of them shares an atomic
`LeaderLease`.

A peer can do local read as long as it holds the following conditions (only list
Hoverbear marked this conversation as resolved.
Show resolved Hide resolved
the most important):
Expand Down Expand Up @@ -84,8 +85,9 @@ them can be resolved by expiring atomic `LeaderLease`.
Local reader is blocked before taking the snapshot while the leadership has
changed.

It is addressed by expiring the leader lease so the request failed lease check
after reading.
It is addressed by expiring the leader lease. After reading, it will be checked
whether the lease is outdated. If yes, the reading results will not be returned
back.

### Case 2

Expand Down