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 Feb 28, 2019
commit c717ef8aacb2a2847425b69b9454f554134d8d5b
8 changes: 4 additions & 4 deletions text/2018-01-03-local-reader.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ leader is in its lease. Read requests are lightweight and the raftstore can
handle them fast. However, due to the single-threaded nature of the raftstore,
read requests may be blocked by other workloads. E.g.,

- Read QPS drops while write requests get more, and the raftstore spends more
time in writing Raft logs.
- Read QPS drops while number of write requests increases, and the raftstore
spends more time in writing Raft logs.
- Read QPS drops while the Regions number grows, and the raftstore spends more
time in driving Raft state machines.

Expand All @@ -28,7 +28,7 @@ and lower latency on read most workload.

## Detailed design

The local reader offloads read requests from the raftstore and guarantee
The local reader offloads read requests from the raftstore and guarantees
linearizability.

### Local reader
Expand All @@ -54,7 +54,7 @@ checks, it redirects read requests to the raftstore.

`LeaderLease` is a state shared by the local reader and the raftstore. It is
critical to implement local reader correctly. When a leader peer steps down,
its delegate is no longer allowed to read, otherwise it may read the stall data
its delegate is no longer allowed to read, otherwise it may read stall data
which violates linearizability. The shared `LeaderLease` is implemented by an
atomic variable, so a delegate observes leadership change immediately and stops
handling read requests.
Expand Down