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 parallel TSO RPC requests on single dispatcher loop #8633

Open
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

MyonKeminta
Copy link
Contributor

What problem does this PR solve?

Issue Number: Close #8432

What is changed and how does it work?

client: Support parallel TSO RPC requests on single dispatcher loop

This commit supports handling multiple TSO RPC concurrently in one single dispatcher loop to reduce the expected time that each GetTS call spent on waiting the next batch.

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.

Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Copy link
Contributor

ti-chi-bot bot commented Sep 14, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@MyonKeminta
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 24, 2024
@MyonKeminta MyonKeminta marked this pull request as ready for review September 24, 2024 20:14
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 24, 2024
immediatelyUpdate = true
})

if !immediatelyUpdate && now.Sub(td.lastCheckConcurrencyTime) < dispatcherCheckRPCConcurrencyInterval {
Copy link
Member

Choose a reason for hiding this comment

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

Don't we need to update td.lastCheckConcurrencyTime here also?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's updated at line 701. We don't update it if it's skipped, otherwise it may never be checked

@@ -228,6 +232,8 @@ var streamIDAlloc atomic.Int32

const invalidStreamID = "<invalid>"

const maxPendingRequestsInTSOStream = 64
Copy link
Member

Choose a reason for hiding this comment

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

Please merge with line 233.

// last time.
if tsoutil.TSLessEqual(physical, firstLogical, lastTSOInfo.physical, lastTSOInfo.logical) {
if tsoutil.TSLessEqual(curTSOInfo.physical, firstLogical, lastTSOInfo.physical, lastTSOInfo.logical) {
log.Panic("[tso] timestamp fallback",
Copy link
Member

Choose a reason for hiding this comment

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

Shall we print out the stream ID here?

@MyonKeminta MyonKeminta force-pushed the m/support-parallel-tso-requests-in-one-stream branch from e26315b to 0bfe9a6 Compare September 25, 2024 04:58
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 58.24742% with 81 lines in your changes missing coverage. Please review.

Project coverage is 77.59%. Comparing base (bd0d4ff) to head (f67467e).
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8633      +/-   ##
==========================================
- Coverage   77.63%   77.59%   -0.04%     
==========================================
  Files         474      474              
  Lines       62097    62311     +214     
==========================================
+ Hits        48209    48352     +143     
- Misses      10340    10393      +53     
- Partials     3548     3566      +18     
Flag Coverage Δ
unittests 77.59% <58.24%> (-0.04%) ⬇️

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

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Sep 25, 2024
@MyonKeminta MyonKeminta force-pushed the m/support-parallel-tso-requests-in-one-stream branch from af1c3d2 to f67467e Compare September 25, 2024 09:31
@MyonKeminta
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot added the lgtm label Sep 25, 2024
Copy link
Contributor

ti-chi-bot bot commented Sep 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JmPotato, lhy1024

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

The pull request process is described 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 removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Sep 25, 2024
Copy link
Contributor

ti-chi-bot bot commented Sep 25, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-09-25 09:08:57.119133261 +0000 UTC m=+1643406.859557201: ☑️ agreed by JmPotato.
  • 2024-09-25 10:47:50.586981506 +0000 UTC m=+1649340.327405444: ☑️ agreed by lhy1024.

Copy link
Contributor

ti-chi-bot bot commented Sep 25, 2024

@MyonKeminta: Your PR was out of date, I have automatically updated it for you.

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.

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.

@MyonKeminta
Copy link
Contributor Author

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

client: Support TSO RPC Parallelizing
3 participants