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

make read quota limiter work for coprocessor as well #13257

Merged
merged 10 commits into from Aug 23, 2022

Conversation

tonyxuqqi
Copy link
Contributor

Signed-off-by: qi.xu tonxuqi@outlook.com

What is changed and how it works?

Issue Number: Close #13256

What's Changed:

The coprocessor's read bytes are not calculated by foreground quota limiter. 

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Manual test

Side effects

  • None

Release note

None

Signed-off-by: qi.xu <tonxuqi@outlook.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 11, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 5kbpers
  • ethercflow

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.

@tonyxuqqi
Copy link
Contributor Author

/cc BornChanger

@ti-chi-bot
Copy link
Member

@tonyxuqqi: GitHub didn't allow me to request PR reviews from the following users: BornChanger.

Note that only tikv members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc BornChanger

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 kubernetes/test-infra repository.

@@ -471,6 +471,9 @@ impl<SS: 'static> BatchExecutorsRunner<SS> {
&mut ctx,
)?
};
if chunk.has_rows_data() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Though I prefer to use following approach. ForwardScanner maintains the statistics (via the Cursor interface), but it's lost before returning to internal_handle_request() in the test. This patch is ok to me at present.
image

Copy link
Contributor Author

@tonyxuqqi tonyxuqqi Aug 11, 2022

Choose a reason for hiding this comment

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

note here the limiter is foreground limiter---that is to limit actual response size back to TiDB, not the IO limiter.

@@ -76,6 +77,7 @@ fn test_select() {
let result_encoded = datum::encode_value(&mut EvalContext::default(), &row).unwrap();
assert_eq!(result_encoded, &*expected_encoded);
}
assert!(limiter.total_read_bytes_consumed(true) > 0); // the consume_sample is called due to read bytes quota
Copy link
Contributor

Choose a reason for hiding this comment

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

why not give a solid number?

Copy link
Contributor Author

@tonyxuqqi tonyxuqqi Aug 11, 2022

Choose a reason for hiding this comment

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

OK, looks that it's doable.

qi.xu and others added 6 commits August 12, 2022 01:18
Signed-off-by: qi.xu <tonxuqi@outlook.com>
Signed-off-by: qi.xu <tonxuqi@outlook.com>
Signed-off-by: qi.xu <tonxuqi@outlook.com>
Signed-off-by: qi.xu <tonxuqi@outlook.com>
@ti-chi-bot
Copy link
Member

@BornChanger: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

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.

Copy link
Member

@ethercflow ethercflow left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Status: PR - There is already 1 approval label Aug 17, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Status: PR - There are already 2 approvals and removed status/LGT1 Status: PR - There is already 1 approval labels Aug 17, 2022
@tonyxuqqi
Copy link
Contributor Author

/test

@5kbpers
Copy link
Member

5kbpers commented Aug 23, 2022

/merge

@ti-chi-bot
Copy link
Member

@5kbpers: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and 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.

If you have any questions about the PR merge process, please refer to pr process.

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.

@ti-chi-bot
Copy link
Member

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

Commit hash: 848ec5d

@ti-chi-bot ti-chi-bot added the status/can-merge Status: Can merge to base branch label Aug 23, 2022
@ti-chi-bot ti-chi-bot merged commit 252b442 into tikv:master Aug 23, 2022
@ti-chi-bot ti-chi-bot added this to the Pool milestone Aug 23, 2022
ti-srebot pushed a commit to ti-srebot/tikv that referenced this pull request Aug 23, 2022
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-6.0 in PR #13323

ti-srebot pushed a commit to ti-srebot/tikv that referenced this pull request Aug 23, 2022
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-6.1 in PR #13324

ti-srebot pushed a commit to ti-srebot/tikv that referenced this pull request Aug 23, 2022
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-6.2 in PR #13325

ti-chi-bot added a commit that referenced this pull request Aug 25, 2022
ref #13257, close #13301

Signed-off-by: BornChanger <dawn_catcher@126.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
TonsnakeLin pushed a commit to TonsnakeLin/tikv that referenced this pull request Aug 29, 2022
ref tikv#13257, close tikv#13301

Signed-off-by: BornChanger <dawn_catcher@126.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: TonsnakeLin <lpbgytong@163.com>
fengou1 pushed a commit to fengou1/tikv that referenced this pull request Aug 30, 2022
close tikv#13256

The coprocessor's read bytes are not calculated by foreground quota limiter.

Signed-off-by: qi.xu <tonxuqi@outlook.com>

Co-authored-by: qi.xu <tonxuqi@outlook.com>
Co-authored-by: 5kbpers <hustmh@gmail.com>
Signed-off-by: fengou1 <feng.ou@pingcap.com>
fengou1 pushed a commit to fengou1/tikv that referenced this pull request Aug 30, 2022
ref tikv#13257, close tikv#13301

Signed-off-by: BornChanger <dawn_catcher@126.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: fengou1 <feng.ou@pingcap.com>
ti-chi-bot bot pushed a commit that referenced this pull request Jun 26, 2023
close #13256, ref #13257

The coprocessor's read bytes are not calculated by foreground quota limiter.

Signed-off-by: qi.xu <tonxuqi@outlook.com>
Signed-off-by: tonyxuqqi <tonyxuqi@outlook.com>

Co-authored-by: qi.xu <tonxuqi@outlook.com>
Co-authored-by: tonyxuqqi <tonyxuqi@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QuotaLimiter: coprocessor read traffic should be controlled by foreground quota limiter's read bytes
6 participants