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

mcs: add lock for forward tso stream #9095

Merged
merged 9 commits into from
Feb 26, 2025
Merged

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Feb 24, 2025

What problem does this PR solve?

Issue Number: Close #9091

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
go test -benchmem -run=^$ -bench ^BenchmarkForwardTsoConcurrently$ github.com/tikv/pd/tests/integrations/mcs/tso -benchtime 120s

client = 3
164         776899433 ns/op        52592338 B/op     446288 allocs/op
182         779831256 ns/op        52671058 B/op     446771 allocs/op
176         776116538 ns/op        52677991 B/op     446741 allocs/op

client = 1
386         342842281 ns/op        17493004 B/op     146447 allocs/op
390         344128967 ns/op        17487349 B/op     146318 allocs/op
379         356701493 ns/op        17528155 B/op     146427 allocs/op

Release note

None.

Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
@lhy1024 lhy1024 requested a review from rleungx February 24, 2025 07:55
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed dco-signoff: yes Indicates the PR's author has signed the dco. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 24, 2025
@lhy1024
Copy link
Contributor Author

lhy1024 commented Feb 24, 2025

cc @AmoebaProtozoa @rleungx

re.NotNil(pdClient)
defer pdClient.Close()
for range 100 {
min, err := pdClient.UpdateServiceGCSafePoint(context.Background(), fmt.Sprintf("service-%d", i), 1000, 1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we need to inject delays into the benchmark for better simulation?

@rleungx
Copy link
Member

rleungx commented Feb 24, 2025

Is there any performance regression?

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

Attention: Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.33%. Comparing base (e3ba3d4) to head (b1ae8ef).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9095      +/-   ##
==========================================
- Coverage   76.41%   76.33%   -0.09%     
==========================================
  Files         468      468              
  Lines       71717    71727      +10     
==========================================
- Hits        54804    54750      -54     
- Misses      13502    13556      +54     
- Partials     3411     3421      +10     
Flag Coverage Δ
unittests 76.33% <93.33%> (-0.09%) ⬇️

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

Copy link
Contributor

ti-chi-bot bot commented Feb 25, 2025

@AmoebaProtozoa: adding LGTM is restricted to approvers and reviewers in OWNERS files.

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

Signed-off-by: lhy1024 <[email protected]>
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Feb 26, 2025
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 26, 2025
Copy link
Contributor

ti-chi-bot bot commented Feb 26, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-26 08:08:15.731976915 +0000 UTC m=+429643.685135181: ☑️ agreed by rleungx.
  • 2025-02-26 08:13:13.911136201 +0000 UTC m=+429941.864294464: ☑️ agreed by nolouch.

Copy link
Contributor

ti-chi-bot bot commented Feb 26, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AmoebaProtozoa, bufferflies, nolouch, rleungx

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:
  • OWNERS [bufferflies,nolouch,rleungx]

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

Signed-off-by: lhy1024 <[email protected]>
@ti-chi-bot ti-chi-bot bot merged commit 0c13897 into tikv:master Feb 26, 2025
25 checks passed
@lhy1024 lhy1024 deleted the forward-lock branch February 26, 2025 08:37
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Feb 27, 2025
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Feb 27, 2025
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #9104.
But this PR has conflicts, please resolve them!

@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. labels Feb 27, 2025
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #9105.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #9106.

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Feb 27, 2025
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #9107.
But this PR has conflicts, please resolve them!

ti-chi-bot bot pushed a commit that referenced this pull request Feb 28, 2025
ti-chi-bot bot pushed a commit that referenced this pull request Mar 3, 2025
ti-chi-bot bot pushed a commit that referenced this pull request Mar 3, 2025
close #9091

Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: lhy1024 <[email protected]>

Co-authored-by: lhy1024 <[email protected]>
Co-authored-by: lhy1024 <[email protected]>
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 needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. 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.

getGlobalTSO may call Recv concurrently on a stream
6 participants