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

client: Support both sync and async interface for tsoStream, to avoid potential performane regression when concurrent RPC is not enabled #8636

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

MyonKeminta
Copy link
Contributor

What problem does this PR solve?

Issue Number:

What is changed and how does it work?

client: Support both sync and async interface for tsoStream, to avoid potential performane regression when concurrent RPC is not enabled

The issue pingcap/tidb#56103 reports a performance regression introduced by PR pingcap/tidb#56093 , which introduces #8483 to TiDB.

It's reasonable that this PR does have risk to introduce performance regression in non-current mode (which would be default after finishing #8432). However:

  • After I rerun the failed bisect task twice, both of these reruns failed to reproduce the regression.
  • According to the previously done microbench (mentioned here), the additional overhead introduced by that PR should not be that much.

So I think the performance regression report looks quite doubtful.

Anyway, I still prepared this PR: the tsoStream provides both sync and async interface. When concurrent RPC is not enabled, the sync interface will be used, making the logic the same as that before merging #8483 .

Check List

Tests

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

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

None.

… potential performane regression when concurrent RPC is not enabled

Signed-off-by: MyonKeminta <[email protected]>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. labels Sep 18, 2024
Copy link
Contributor

ti-chi-bot bot commented Sep 18, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign bufferflies for approval. For more information see the Code Review Process.

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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 18, 2024
Copy link

codecov bot commented Sep 18, 2024

Codecov Report

Attention: Patch coverage is 69.86301% with 22 lines in your changes missing coverage. Please review.

Project coverage is 77.66%. Comparing base (71f6f96) to head (16b59c7).
Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8636      +/-   ##
==========================================
+ Coverage   77.57%   77.66%   +0.09%     
==========================================
  Files         474      474              
  Lines       62033    62125      +92     
==========================================
+ Hits        48122    48251     +129     
+ Misses      10355    10313      -42     
- Partials     3556     3561       +5     
Flag Coverage Δ
unittests 77.66% <69.86%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
@MyonKeminta MyonKeminta force-pushed the m/support-both-sync-and-async-interface-for-tso-stream branch from c437f8f to 16b59c7 Compare September 19, 2024 08:48
Copy link
Contributor

ti-chi-bot bot commented Sep 19, 2024

[FORMAT CHECKER NOTIFICATION]

Notice: To remove the do-not-merge/needs-linked-issue label, please provide the linked issue number on one line in the PR body, for example: Issue Number: close #123 or Issue Number: ref #456, multiple issues should use full syntax for each issue and be separated by a comma, like: Issue Number: close #123, ref #456.

📖 For more info, you can check the "Linking issues" section in the CONTRIBUTING.md.

Copy link
Contributor

ti-chi-bot bot commented Sep 19, 2024

@MyonKeminta: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-integration-realcluster-test 16b59c7 link false /test pull-integration-realcluster-test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@@ -328,10 +328,10 @@ tsoBatchLoop:
case td.tsDeadlineCh <- dl:
}
// processRequests guarantees that the collected requests could be finished properly.
err = td.processRequests(stream, dc, batchController, done)
tbcConsumed, err := td.processRequests(stream, dc, batchController, done, td.useAsyncStream())
Copy link
Contributor

Choose a reason for hiding this comment

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

This means that if we don't turn on the newly introduced feature, it will always work in a synchronized way, do I understand correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. But let's hold this PR for now as the performance regression is currently very likely to be a misreport due to the unstable test environment.

@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 27, 2024
Copy link
Contributor

ti-chi-bot bot commented Sep 27, 2024

PR needs rebase.

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-sigs/prow repository.

@MyonKeminta MyonKeminta marked this pull request as draft October 10, 2024 06:29
@ti-chi-bot ti-chi-bot bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants