-
Notifications
You must be signed in to change notification settings - Fork 719
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: support hotPeerCache maintained in Peer level #3627
Conversation
Signed-off-by: yisaer <disxiaofei@163.com>
Codecov Report
@@ Coverage Diff @@
## master #3627 +/- ##
==========================================
+ Coverage 74.62% 74.63% +0.01%
==========================================
Files 245 245
Lines 24144 24240 +96
==========================================
+ Hits 18017 18092 +75
- Misses 4512 4528 +16
- Partials 1615 1620 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
server/statistics/hot_peer_cache.go
Outdated
@@ -450,3 +437,70 @@ func (f *hotPeerCache) updateHotPeerStat(newItem, oldItem *HotPeerStat, bytes, k | |||
} | |||
return newItem | |||
} | |||
|
|||
// TODO: remove it in future | |||
func (f *hotPeerCache) getRegionBytes(region *core.RegionInfo) uint64 { |
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 seems to be related with #3591
701d043
to
6e91990
Compare
6e91990
to
950e6ea
Compare
/run-tests |
/run-test |
…o make_schedule_peer
Signed-off-by: yisaer <disxiaofei@163.com>
Signed-off-by: yisaer <disxiaofei@163.com>
Signed-off-by: yisaer <disxiaofei@163.com>
Signed-off-by: yisaer <disxiaofei@163.com>
Signed-off-by: yisaer <disxiaofei@163.com>
Signed-off-by: yisaer <disxiaofei@163.com>
isExpired := f.isPeerExpired(peer, region) | ||
oldItem := f.getOldHotPeerStat(region.GetID(), storeID) | ||
if isExpired && oldItem != nil && !f.isInheritExist(region.GetID()) { | ||
f.putInheritItem(oldItem) |
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.
Will it cause race?
server/statistics/hot_peer_cache.go
Outdated
// transfer read leader or remove write peer | ||
isExpired := f.isPeerExpired(peer, region) | ||
oldItem := f.getOldHotPeerStat(region.GetID(), storeID) | ||
if isExpired && oldItem != nil && !f.isInheritExist(region.GetID()) { |
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 need to judge whether exist in inherit items?
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.
removed
server/statistics/hot_peer_cache.go
Outdated
|
||
func (f *hotPeerCache) isInheritExist(regionID uint64) bool { | ||
item, ok := f.inheritItem[regionID] | ||
return ok && item != 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.
when is it 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.
when there is no inherit item.
Signed-off-by: yisaer <disxiaofei@163.com>
Signed-off-by: yisaer <disxiaofei@163.com>
server/statistics/hot_cache.go
Outdated
for { | ||
select { | ||
case <-ctx.Done(): | ||
close(w.readFlowQueue) |
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's better to close it on send side.
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.
updated.
Signed-off-by: yisaer <disxiaofei@163.com>
Signed-off-by: yisaer <disxiaofei@163.com>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
[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 |
@Yisaer: 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: c4d33ca
|
/run-integration-ddl-test |
Signed-off-by: yisaer disxiaofei@163.com
What problem does this PR solve?
What is changed and how it works?
make hotPeerCache maintained by peer level
Release note