-
Notifications
You must be signed in to change notification settings - Fork 725
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
Fix hot peer cache threshold unstable when interval unstable #3417
Conversation
Signed-off-by: lhy1024 <admin@liudos.us>
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.
LGTM, but the test is failed
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.
lgtm, plz fix the test.
Codecov Report
@@ Coverage Diff @@
## master #3417 +/- ##
==========================================
- Coverage 74.99% 74.93% -0.07%
==========================================
Files 244 244
Lines 23554 23556 +2
==========================================
- Hits 17664 17651 -13
- Misses 4314 4322 +8
- Partials 1576 1583 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
lgtm
isHot := bytes/interval.Seconds() >= newItem.thresholds[byteDim] || keys/interval.Seconds() >= newItem.thresholds[keyDim] | ||
if !isHot { | ||
return nil | ||
} | ||
if interval.Seconds() >= RegionHeartBeatReportInterval { | ||
isHot := bytes/interval.Seconds() >= newItem.thresholds[byteDim] || keys/interval.Seconds() >= newItem.thresholds[keyDim] | ||
if !isHot { | ||
return nil | ||
} |
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.
I'm wondering what's difference here? It seems the result won't be changed with the given isHot
and interval.Seconds() >= RegionHeartBeatReportInterval
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.
it will directly return nil when the interval is less than RegionHeartBeatReportInterval
[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 writing |
/merge |
@nolouch: 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. |
This pull request has been accepted and is ready to merge. Commit hash: 9bfd29d
|
@lhy1024: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /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. |
Signed-off-by: lhy1024 admin@liudos.us
What problem does this PR solve?
Before PR, we add peer to the hot peer cache when its interval is less than normal, which causes topn will increase a lot when the heartbeat interval is unstable. We calculate the threshold by the 60th item in the hot peer cache, so the threshold will reduce to the default threshold while a lot of peers are added to the hot peer cache.
What is changed and how it works?
we add peer to the hot peer cache when its interval is less than normal only when it is hot too.
Check List
Tests
Release note