-
Notifications
You must be signed in to change notification settings - Fork 727
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
schedulers: fix cache item in hot peer cache and add more test #2463
Conversation
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
/rebuild |
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
/rebuild |
Could you add a test? |
Codecov Report
@@ Coverage Diff @@
## master #2463 +/- ##
==========================================
+ Coverage 77.11% 77.29% +0.18%
==========================================
Files 204 204
Lines 22026 22032 +6
==========================================
+ Hits 16985 17030 +45
+ Misses 3757 3733 -24
+ Partials 1284 1269 -15
Continue to review full report at Codecov.
|
Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
for _, storeID := range storeIDs { | ||
isExpired := f.isRegionExpired(region, storeID) | ||
isExpired := f.isRegionExpired(region, storeID) // transfer leader or remove peer |
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 realized that it seems we can directly update the cache instead of returning the item which needs to be updated?
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 will open another PR to merge them.
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.
why directly update the cache? we need to check it first for reducing heartbeat lock overload.
const interval = uint64(60) | ||
|
||
func schedule(operator operator, region *core.RegionInfo, kind FlowKind) *core.RegionInfo { | ||
func schedule(operator operator, region *core.RegionInfo, kind FlowKind) (srcStore uint64, _ *core.RegionInfo) { |
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.
func schedule(operator operator, region *core.RegionInfo, kind FlowKind) (srcStore uint64, _ *core.RegionInfo) { | |
func schedule(operator operator, region *core.RegionInfo, kind FlowKind) (uint64, *core.RegionInfo) { |
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 want to indicate the meaning of this return var, I think it is better than putting it in a comment
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 want to indicate the meaning of this return var, I think it is better than putting it in a comment
I agree
cc @lhy1024 |
Signed-off-by: lhy1024 <[email protected]>
PTAL @rleungx |
/merge |
/run-all-tests |
cherry pick to release-3.1 in PR #2548 |
cherry pick to release-4.0 in PR #2549 |
#2549) Signed-off-by: lhy1024 <[email protected]>
#2548) Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 [email protected]
What problem does this PR solve?
Fix #2468
What is changed and how it works?
Prepare the cache item in advance
Check List
Tests
Release note