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: remove canceled requests before sending #10634

Merged
merged 4 commits into from
May 31, 2019

Conversation

coocood
Copy link
Member

@coocood coocood commented May 29, 2019

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

  • Unit test

@coocood coocood requested a review from hicqu May 29, 2019 06:07
@codecov
Copy link

codecov bot commented May 29, 2019

Codecov Report

Merging #10634 into master will decrease coverage by <.0001%.
The diff coverage is 92.3076%.

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

codecov bot commented May 29, 2019

Codecov Report

Merging #10634 into master will increase coverage by 0.0151%.
The diff coverage is 78.9473%.

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

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?

Copy link
Member Author

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.

@coocood
Copy link
Member Author

coocood commented May 31, 2019

@lysu PTAL

@hicqu
Copy link
Contributor

hicqu commented May 31, 2019

LGTM

hicqu
hicqu previously approved these changes May 31, 2019
@coocood
Copy link
Member Author

coocood commented May 31, 2019

/run-all-tests

@coocood
Copy link
Member Author

coocood commented May 31, 2019

/run-integration-common-test

@coocood
Copy link
Member Author

coocood commented May 31, 2019

/run-integration-common-test

@coocood
Copy link
Member Author

coocood commented May 31, 2019

@tiancaiamao PTAL

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.

LGTM

@lysu lysu added status/LGT2 Indicates that a PR has LGTM 2. status/all tests passed labels May 31, 2019
@coocood
Copy link
Member Author

coocood commented May 31, 2019

/run-all-tests

@tiancaiamao
Copy link
Contributor

LGTM

@tiancaiamao tiancaiamao merged commit c76e5ed into pingcap:master May 31, 2019
@coocood coocood deleted the check-cancel branch May 31, 2019 05:03
coocood added a commit to coocood/tidb that referenced this pull request May 31, 2019
coocood added a commit that referenced this pull request Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tikv status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants