-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
store/tikv: increase max backoff time of read requests #25153
Conversation
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
@@ -745,7 +746,7 @@ func (tm *ttlManager) keepAlive(c *twoPhaseCommitter) { | |||
if tm.lockCtx != nil && tm.lockCtx.Killed != nil && atomic.LoadUint32(tm.lockCtx.Killed) != 0 { | |||
return | |||
} | |||
bo := retry.NewBackofferWithVars(context.Background(), pessimisticLockMaxBackoff, c.txn.vars) | |||
bo := retry.NewBackofferWithVars(context.Background(), keepAliveMaxBackoff, c.txn.vars) |
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.
I think it shouldn't break the loop if the error is not a key error at L779.
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.
Rest lgtm
store/tikv/pessimistic.go
Outdated
@@ -132,10 +132,22 @@ func (action actionPessimisticLock) handleSingleBatch(c *twoPhaseCommitter, bo * | |||
return errors.Trace(err) | |||
} | |||
if regionErr != nil { | |||
err = bo.Backoff(retry.BoRegionMiss, errors.New(regionErr.String())) | |||
/// For other region error and the fake region error, backoff because |
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.
/// For other region error and the fake region error, backoff because | |
// For other region error and the fake region error, backoff because |
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
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.
rest LGTM
store/tikv/2pc.go
Outdated
} | ||
continue | ||
} | ||
if resp.Resp == nil { | ||
return 0, errors.Trace(tikverr.ErrBodyMissing) | ||
return 0, errors.Trace(err), false |
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.
those err
should always be nil~?
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.
Sorry, it's a copy-paste mistake...
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 6fb6d1d
|
@sticnarf Please fix the linting check. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 4d42c42
|
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 1091693
|
@sticnarf: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. 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 ti-community-infra/tichi repository. |
/rebuild |
What is changed and how it works?
Like how #25040 changes prewrite and commit, this PR increases the max backoff to 10 minutes. So, if some TiKV regions are unavailable in a short time due to slow apply, the user will not receive an error.
This PR also make real
EpochNotMatch
errors not backoff.Check List
Tests
Release note
Increase timeout for read requests to avoid propagating TiKV errors.