Skip to content

moving_filter: fix data race with cache result (#6080)#6087

Merged
ti-chi-bot merged 2 commits intotikv:release-6.5from
ti-chi-bot:cherry-pick-6080-to-release-6.5
Mar 3, 2023
Merged

moving_filter: fix data race with cache result (#6080)#6087
ti-chi-bot merged 2 commits intotikv:release-6.5from
ti-chi-bot:cherry-pick-6080-to-release-6.5

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Member

This is an automated cherry-pick of #6080

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.

ref tikv#5798, close tikv#6069

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Copy Markdown
Member Author

ti-chi-bot commented Mar 3, 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.

Details

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/cherry-pick-not-approved release-note-none Denotes a PR that doesn't merit a release note. type/cherry-pick-for-release-6.5 This PR is cherry-picked to release-6.5 from a source PR. labels Mar 3, 2023
@ti-chi-bot ti-chi-bot requested review from HunDunDM and lhy1024 March 3, 2023 05:37
@VelocityLight VelocityLight added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Mar 3, 2023
Signed-off-by: lhy1024 <admin@liudos.us>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 3, 2023
@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
Copy Markdown
Contributor

lhy1024 commented Mar 3, 2023

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member Author

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

/run-all-tests

Details

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
Copy Markdown
Member Author

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

DetailsCommit hash: 25cef0a

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

codecov bot commented Mar 3, 2023

Codecov Report

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

Comparison is base (297cee8) 75.65% compared to head (25cef0a) 75.58%.

Additional details and impacted files
@@               Coverage Diff               @@
##           release-6.5    #6087      +/-   ##
===============================================
- Coverage        75.65%   75.58%   -0.08%     
===============================================
  Files              330      330              
  Lines            32961    32960       -1     
===============================================
- Hits             24937    24913      -24     
- Misses            5875     5895      +20     
- Partials          2149     2152       +3     
Flag Coverage Δ
unittests 75.58% <100.00%> (-0.08%) ⬇️

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/tempurl/tempurl.go 45.00% <0.00%> (-15.00%) ⬇️
server/tso/local_allocator.go 62.16% <0.00%> (-9.46%) ⬇️
server/region_syncer/client.go 81.34% <0.00%> (-5.23%) ⬇️
server/id/id.go 83.05% <0.00%> (-3.39%) ⬇️
server/region_syncer/server.go 82.96% <0.00%> (-3.30%) ⬇️
server/tso/tso.go 70.22% <0.00%> (-2.81%) ⬇️
server/encryptionkm/key_manager.go 70.11% <0.00%> (-1.60%) ⬇️
server/schedulers/hot_region_v2.go 88.30% <0.00%> (-1.17%) ⬇️
server/statistics/store_collection.go 93.75% <0.00%> (-0.63%) ⬇️
... and 12 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 merged commit 5a6f460 into tikv:release-6.5 Mar 3, 2023
@VelocityLight VelocityLight added do-not-merge/cherry-pick-not-approved cherry-pick-approved Cherry pick PR approved by release team. and removed cherry-pick-approved Cherry pick PR approved by release team. do-not-merge/cherry-pick-not-approved labels Mar 13, 2023
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. 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-6.5 This PR is cherry-picked to release-6.5 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants