-
Notifications
You must be signed in to change notification settings - Fork 726
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
client/tso: use the TSO request pool at the tsoClient level to avoid data race #8077
Conversation
[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. |
Signed-off-by: JmPotato <[email protected]>
Signed-off-by: JmPotato <[email protected]>
7f5f1e7
to
43b4611
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #8077 +/- ##
==========================================
- Coverage 77.29% 77.26% -0.04%
==========================================
Files 469 470 +1
Lines 61097 61104 +7
==========================================
- Hits 47225 47212 -13
- Misses 10313 10321 +8
- Partials 3559 3571 +12
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -838,12 +823,22 @@ func (c *client) dispatchTSORequestWithRetry(req *tsoRequest) error { | |||
err = errs.ErrClientGetTSO.FastGenByArgs("tso client is nil") | |||
continue | |||
} | |||
// Get a new request from the pool if it's nil or not from the current pool. | |||
if req == nil || req.pool != tsoClient.tsoReqPool { |
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.
When will req.pool != tsoClient.tsoReqPool
happen?
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.
During the retry period, a mode switch occurred causing the tsoClient
to be updated.
/merge |
@JmPotato: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
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. |
This pull request has been accepted and is ready to merge. Commit hash: 43b4611
|
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request could not be created: failed to create pull request against tikv/pd#release-8.1 from head ti-chi-bot:cherry-pick-8077-to-release-8.1: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-8077-to-release-8.1."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request"} |
…data race (#8077) (#8141) close #8055, ref #8076 Use the TSO request pool at the `tsoClient` level to avoid data race. Signed-off-by: JmPotato <[email protected]> Co-authored-by: JmPotato <[email protected]>
What problem does this PR solve?
Issue Number: close #8055, ref #8076.
What is changed and how does it work?
Check List
Tests
Release note