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

moving_filter: fix data race with cache result #6080

Merged
merged 2 commits into from
Mar 3, 2023

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Mar 2, 2023

What problem does this PR solve?

Issue Number: Close #6069

What is changed and how does it work?

after #5798 we use cache result in median.Get to reduce memory, but it introduces a write operation in get, so we remove write op in get function to avoid data race. And considering there is more get than add, it still is valid to reduce memory and CPU time.

Check List

Tests

  • Unit test
  • Integration test

Release note

None.

@lhy1024 lhy1024 requested review from HunDunDM and rleungx March 2, 2023 11:57
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 2, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CabinfeverB
  • HunDunDM

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 do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. labels Mar 2, 2023
@codecov
Copy link

codecov bot commented Mar 2, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.26 ⚠️

Comparison is base (6fa2bc9) 74.10% compared to head (6a60d16) 73.84%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6080      +/-   ##
==========================================
- Coverage   74.10%   73.84%   -0.26%     
==========================================
  Files         381      381              
  Lines       37809    37801       -8     
==========================================
- Hits        28020    27916     -104     
- Misses       7335     7416      +81     
- Partials     2454     2469      +15     
Flag Coverage Δ
unittests 73.84% <100.00%> (-0.26%) ⬇️

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

Impacted Files Coverage Δ
pkg/movingaverage/median_filter.go 100.00% <100.00%> (ø)
pkg/tso/local_allocator.go 62.16% <0.00%> (-16.22%) ⬇️
pkg/tso/allocator_manager.go 58.83% <0.00%> (-7.46%) ⬇️
pkg/utils/metricutil/metricutil.go 82.75% <0.00%> (-6.90%) ⬇️
client/resource_group/controller/limiter.go 61.25% <0.00%> (-6.25%) ⬇️
server/region_syncer/server.go 82.96% <0.00%> (-4.40%) ⬇️
pkg/tso/tso.go 67.97% <0.00%> (-3.94%) ⬇️
pkg/id/id.go 86.44% <0.00%> (-3.39%) ⬇️
pkg/storage/kv/etcd_kv.go 72.22% <0.00%> (-3.18%) ⬇️
pkg/tso/global_allocator.go 60.20% <0.00%> (-1.05%) ⬇️
... and 13 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ti-chi-bot ti-chi-bot added needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. and removed do-not-merge/needs-triage-completed labels Mar 2, 2023
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 3, 2023
@rleungx
Copy link
Member

rleungx commented Mar 3, 2023

Do you just revert the changes before?

@lhy1024
Copy link
Contributor Author

lhy1024 commented Mar 3, 2023

Do you just revert the changes before?

Use another way to reduce unnecessary memory in get

@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 Mar 3, 2023
@lhy1024
Copy link
Contributor Author

lhy1024 commented Mar 3, 2023

/merge

@ti-chi-bot
Copy link
Member

@lhy1024: 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

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

Commit hash: b8ef9f9

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 3, 2023
@ti-chi-bot
Copy link
Member

@lhy1024: 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.

@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Mar 3, 2023
ti-chi-bot added a commit that referenced this pull request Mar 3, 2023
ref #5798, close #6069, ref #6080

Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-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
needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PD data races report
5 participants