-
Notifications
You must be signed in to change notification settings - Fork 227
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 as stale if leader is not accessible #1534
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
c43bc04
to
53cd393
Compare
internal/locate/replica_selector.go
Outdated
// don't overwhelm the leader if it is busy | ||
|
||
maxAttempt := 1 | ||
if !replica.isExhausted(maxAttempt, 0) || replica.hasFlag(deadlineErrUsingConfTimeoutFlag) || replica.hasFlag(serverIsBusyFlag) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The !replica.isExhausted(maxAttempt, 0)
is a little bit confusing, is it intended to check the leader.attempts == 0
which means the leader is not attempted at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, i modified the code.
Signed-off-by: rishabh_mittal <[email protected]>
Signed-off-by: rishabh_mittal <[email protected]>
Signed-off-by: rishabh_mittal <[email protected]>
Signed-off-by: rishabh_mittal <[email protected]>
Signed-off-by: rishabh_mittal <[email protected]>
Signed-off-by: rishabh_mittal <[email protected]>
b7c346d
to
fca73d9
Compare
issue number : tikv/tikv#17422
It is the extension of the original PR #1509. I have observed that in case of hot regions, leaders are inaccessible and stale reads are retried as follower_follower. I have added a change if leader is not reachable or epoch doesn't mach than retry stale read as stale instead of follower.