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

statistics: remove mutex in hotPeerCache (#3721) #3751

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #3721

Signed-off-by: yisaer [email protected]

try to remove mutex

Signed-off-by: yisaer [email protected]

What problem does this PR solve?

We use mutex in hotPeerCache which may cause mutex contention.

What is changed and how it works?

This request remove the mutex and refactor flowItem with a proper way.

Tests

I used pd-heartbeat-bench to test pd heartbeat (1 server / 6 cpu), here is the result

v5.0.0

Update speed of each category:
  Requests/sec:      8263.3143
  Save-Tree/sec:        0.0000
  Save-KV/sec:          0.0000
  Save-Space/sec:       0.0000
  Save-Flow/sec:     4131.6572
  Skip/sec:          4131.6572
master

Update speed of each category:
  Requests/sec:      6137.2065
  Save-Tree/sec:        0.0000
  Save-KV/sec:          0.0000
  Save-Space/sec:       0.0000
  Save-Flow/sec:     3068.6033
  Skip/sec:          3068.6033
This request

Update speed of each category:
  Requests/sec:     10228.7168
  Save-Tree/sec:        0.0000
  Save-KV/sec:          0.0000
  Save-Space/sec:       0.0000
  Save-Flow/sec:     5114.3584
  Skip/sec:          5114.3584

Release note

None

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. priority/P0 The issue has P0 priority. type/cherry-pick-for-release-5.1 The PR belongs to release-5.1 cherry pick. labels Jun 7, 2021
@zhouqiang-cl zhouqiang-cl added the cherry-pick-approved Cherry pick PR approved by release team. label Jun 8, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 11, 2021
@nolouch
Copy link
Contributor

nolouch commented Jun 11, 2021

@Yisaer DCO failed.

@Yisaer Yisaer force-pushed the cherry-pick-3721-to-release-5.1 branch from d43c224 to 61fac00 Compare June 11, 2021 11:03
@Yisaer
Copy link
Contributor

Yisaer commented Jun 11, 2021

/merge

@ti-chi-bot
Copy link
Member Author

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

/run-all-tests

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 Author

@Yisaer: /merge in this pull request requires 2 approval(s).

In response to this:

/merge

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 Author

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Yisaer
  • nolouch

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.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 11, 2021
@Yisaer
Copy link
Contributor

Yisaer commented Jun 11, 2021

/merge

@ti-chi-bot
Copy link
Member Author

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

/run-all-tests

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 Author

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

Commit hash: 61fac00

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 11, 2021
@Yisaer
Copy link
Contributor

Yisaer commented Jun 11, 2021

/run-integration-common-test

@codecov
Copy link

codecov bot commented Jun 11, 2021

Codecov Report

Merging #3751 (74d221f) into release-5.1 (deec776) will increase coverage by 0.19%.
The diff coverage is 82.44%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release-5.1    #3751      +/-   ##
===============================================
+ Coverage        74.93%   75.13%   +0.19%     
===============================================
  Files              244      245       +1     
  Lines            24504    24544      +40     
===============================================
+ Hits             18363    18441      +78     
+ Misses            4510     4487      -23     
+ Partials          1631     1616      -15     
Flag Coverage Δ
unittests 75.13% <82.44%> (+0.19%) ⬆️

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

Impacted Files Coverage Δ
server/statistics/hot_peer_cache.go 95.65% <ø> (-0.20%) ⬇️
server/statistics/hot_cache_task.go 75.43% <75.43%> (ø)
server/statistics/hot_cache.go 87.23% <85.71%> (-9.51%) ⬇️
pkg/mock/mockcluster/mockcluster.go 95.71% <100.00%> (+0.01%) ⬆️
server/cluster/cluster.go 83.39% <100.00%> (+0.54%) ⬆️
server/statistics/hotstat.go 100.00% <100.00%> (ø)
server/schedule/region_scatterer.go 83.72% <0.00%> (-4.66%) ⬇️
server/election/leadership.go 85.88% <0.00%> (-1.18%) ⬇️
server/schedule/operator/step.go 67.44% <0.00%> (-1.00%) ⬇️
server/grpc_service.go 47.54% <0.00%> (-0.23%) ⬇️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update deec776...74d221f. Read the comment docs.

@ti-chi-bot ti-chi-bot merged commit 3307f13 into tikv:release-5.1 Jun 11, 2021
@HunDunDM HunDunDM added this to the v5.1.0 milestone Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. priority/P0 The issue has P0 priority. release-note-none Denotes a PR that doesn't merit a release note. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/cherry-pick-for-release-5.1 The PR belongs to release-5.1 cherry pick.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants