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

store/tikv: increase max backoff time of read requests #25153

Merged
merged 15 commits into from
Jun 6, 2021

Conversation

sticnarf
Copy link
Contributor

@sticnarf sticnarf commented Jun 4, 2021

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

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Release note

  • Increase timeout for read requests to avoid propagating TiKV errors.

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
@sticnarf sticnarf added the sig/transaction SIG:Transaction label Jun 4, 2021
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 4, 2021
@sticnarf sticnarf requested a review from youjiali1995 June 4, 2021 08:47
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
@sticnarf sticnarf requested review from lysu and ekexium June 4, 2021 10:59
@@ -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)
Copy link
Contributor

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.

Copy link
Contributor

@youjiali1995 youjiali1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest lgtm

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// For other region error and the fake region error, backoff because
// For other region error and the fake region error, backoff because

@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 4, 2021
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 4, 2021
Copy link
Contributor

@lysu lysu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM

}
continue
}
if resp.Resp == nil {
return 0, errors.Trace(tikverr.ErrBodyMissing)
return 0, errors.Trace(err), false
Copy link
Contributor

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~?

Copy link
Contributor Author

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>
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lysu
  • youjiali1995

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 5, 2021
@lysu
Copy link
Contributor

lysu commented Jun 5, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 6fb6d1d

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 5, 2021
@bb7133
Copy link
Member

bb7133 commented Jun 5, 2021

[2021-06-05T07:53:19.089Z] GO111MODULE=on go build -o ../bin/revive github.com/mgechev/revive
[2021-06-05T07:53:19.089Z] linting
[2021-06-05T07:53:19.089Z]   ✘  https://revive.run/r#error-return  error should be the last type when returning multiple items  
[2021-06-05T07:53:19.089Z]   store/tikv/2pc.go:802:1
[2021-06-05T07:53:19.089Z] 

@sticnarf Please fix the linting check.

ti-chi-bot and others added 2 commits June 6, 2021 01:30
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Jun 6, 2021
@sticnarf
Copy link
Contributor Author

sticnarf commented Jun 6, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 4d42c42

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 6, 2021
ti-chi-bot and others added 2 commits June 6, 2021 13:30
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Jun 6, 2021
@sticnarf
Copy link
Contributor Author

sticnarf commented Jun 6, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 1091693

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 6, 2021
@ti-chi-bot
Copy link
Member

@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.

@sticnarf
Copy link
Contributor Author

sticnarf commented Jun 6, 2021

/rebuild

@ti-chi-bot ti-chi-bot merged commit 7cc1ebc into pingcap:master Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/transaction SIG:Transaction size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants