-
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: remove canceled requests before sending #10634
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10634 +/- ##
==============================================
- Coverage 77.6801% 77.68% -0.0001%
==============================================
Files 413 413
Lines 87505 87563 +58
==============================================
+ Hits 67974 68019 +45
- Misses 14378 14387 +9
- Partials 5153 5157 +4 |
Codecov Report
@@ Coverage Diff @@
## master #10634 +/- ##
================================================
+ Coverage 78.1549% 78.1701% +0.0151%
================================================
Files 413 413
Lines 87498 87568 +70
================================================
+ Hits 68384 68452 +68
- Misses 13971 13972 +1
- Partials 5143 5144 +1 |
@@ -506,6 +514,23 @@ func (a *connArray) batchSendLoop(cfg config.TiKVClient) { | |||
} | |||
} | |||
|
|||
// removeCanceledRequests removes canceled requests before sending. | |||
func removeCanceledRequests( |
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.
How about write the logic in fetchPendingRequest
to reduce allocaction?
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.
It's possible that after wait for tikv overload, some of the requests canceled.
This way removes more canceled requests.
@lysu PTAL |
LGTM |
/run-all-tests |
/run-integration-common-test |
/run-integration-common-test |
@tiancaiamao PTAL |
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.
LGTM
/run-all-tests |
LGTM |
What problem does this PR solve?
When requests are canceled, we still send the requests to TiKV.
What is changed and how it works?
Remove the canceled requests before sending.
Check List
Tests