-
Notifications
You must be signed in to change notification settings - Fork 720
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: fix data race in IsRegionHot
#8336
Conversation
Signed-off-by: lhy1024 <[email protected]>
@@ -113,18 +113,20 @@ func (w *HotCache) IsRegionHot(region *core.RegionInfo, minHotDegree int) bool { | |||
succ1 := w.CheckWriteAsync(checkRegionHotWriteTask) | |||
succ2 := w.CheckReadAsync(checkRegionHotReadTask) | |||
if succ1 && succ2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If retRead and retWrite are true and false, we should return true, not either of them.
Signed-off-by: lhy1024 <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: HuSharp, 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:
Approvers can indicate their approval by writing |
In response to a cherrypick label: new pull request created to branch |
close #8335 Signed-off-by: lhy1024 <[email protected]> Co-authored-by: lhy1024 <[email protected]>
fixed in #8342 |
What problem does this PR solve?
Issue Number: Close #8335
Before #8164 it is
What is changed and how does it work?
Check List
Tests
Unit test
Test1:
This test will meet data race in master and is normal in this PR.
This test will be successful in this PR and be failed in master branches
Release note