-
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 the problem that the hot cache cannot be emptied when the interval is less than 60 (#4396) #4431
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: lhy1024 <admin@liudos.us>
e46a4e5
to
1fafee4
Compare
Codecov Report
@@ Coverage Diff @@
## release-4.0 #4431 +/- ##
===============================================
- Coverage 75.38% 74.78% -0.61%
===============================================
Files 211 211
Lines 20090 20129 +39
===============================================
- Hits 15145 15053 -92
- Misses 3613 3739 +126
- Partials 1332 1337 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
[FORMAT CHECKER NOTIFICATION] Please provide the associated issue number in the commit messages, for example: |
This pull request is closed because it's related version has closed automatic cherry-picking. You can find more details at: |
This is an automated cherry-pick of #4396,wait for #4446
What problem does this PR solve?
close #4390
What is changed and how it works?
Our current heartbeat process looks like this.
If the interval is less than the default interval for heartbeats (60 seconds), then we will put it into the cache temporarily and wait until it has made up 60 seconds before considering whether it is hot enough.
For a peer that has just been reported, if the region is also in the hot cache, then there are three cases.
The problem occurs in the third branch, if the old peer is used directly without clone, then the old item and the new item will be written at the same time. And when the new peer interval is less than 60 seconds, it means that it will be temporarily put into the cache.
If the old peer will be cooled down at this time, it will keep the peer in the hot cache for a long time and cannot be exited.
This pr does a clone for the third branch to avoid this problem, and changes the store and region heartbeats to configurable in another pr.
Check List
Tests
Release note