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

raft: support follower read #1280

Closed
siddontang opened this issue Nov 8, 2016 · 2 comments
Closed

raft: support follower read #1280

siddontang opened this issue Nov 8, 2016 · 2 comments
Labels
sig/raft Component: Raft, RaftStore, etc.

Comments

@siddontang
Copy link
Contributor

siddontang commented Nov 8, 2016

For raft thesis "6.4 Processing read-only queries more efficiently"

We can use raft ReadIndex to support follower read to improve whole read throughput and divert load away from leader.

For both leader and follower, we can:

  • For the read command without "read-quorum", call ReadIndex and pass the context to it.
  • In raft handle ready, get the context from the read only state, call the associated callback with the current snapshot.

Note:

  • Now we use check_lease for leader read-only command, using ReadIndex may reduce a little performance because we may call raft step and handle in ready. But ReadIndex can unify the code for leader and follower read-only command.
  • Should consider the timeout and clean up the pending command if ready has no read only state for a long time.
  • Make sure this can work well with scheduler latch, no side effect.
@siddontang siddontang added todo sig/raft Component: Raft, RaftStore, etc. labels Nov 8, 2016
@siddontang siddontang added this to the RC1 milestone Nov 8, 2016
@siddontang siddontang removed this from the RC1 milestone Nov 24, 2016
@siddontang siddontang removed the todo label Dec 22, 2016
@Hoverbear
Copy link
Contributor

@Fullstop000 is working on an RFC for this!

@overvenus
Copy link
Member

It has been supported by #5051

iosmanthus pushed a commit to iosmanthus/tikv that referenced this issue May 31, 2024
Signed-off-by: Ping Yu <[email protected]>
Signed-off-by: yongman <[email protected]>
Co-authored-by: yongman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/raft Component: Raft, RaftStore, etc.
Projects
None yet
Development

No branches or pull requests

4 participants