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

retry stale read on follower if leader timeout #1450

Open
wants to merge 4 commits into
base: tidb-7.5
Choose a base branch
from

Conversation

mittalrishabh
Copy link

@mittalrishabh mittalrishabh commented Aug 27, 2024

issue number : tikv/tikv#17422

Currently stale read is always retried as leader read or follower read. Follower read can overwhelm the leader if is leader raft state machine is slow.
In this fix, request is retried as stale reads to replica if leader read returns deadline_exceeded error.

After this fix :
If original request is doing stale read
Retry 1 : Try Leader read
if error is deadline exceeded
Retry 2 : Try replica 1 with stale read
Retry 3 : try replica 2 with stale read

If there is any other error
Retry 2: Try replica 1 with follower read
Retry 3 : Try replica 2 with follower read

Copy link

ti-chi-bot bot commented Aug 27, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign you06 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added dco-signoff: no Indicates the PR's author has not signed dco. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 27, 2024
Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
Copy link

ti-chi-bot bot commented Sep 1, 2024

Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits.

📝 Please follow instructions in the contributing guide to update your commits with the DCO

Full details of the Developer Certificate of Origin can be found at developercertificate.org.

The list of commits missing DCO signoff:

  • 98c36b1 retry stale read on follower if leader timeout
  • d3a5edf Update region_request.go

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: no Indicates the PR's author has not signed dco. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant