-
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
cluster,statistics: support recving peer stat by store heartbeat #3665
Conversation
3950413
to
e260fcb
Compare
e260fcb
to
fa0fe5d
Compare
Signed-off-by: yisaer <disxiaofei@163.com>
Signed-off-by: yisaer <disxiaofei@163.com>
37031ce
to
48ef084
Compare
Signed-off-by: yisaer <disxiaofei@163.com>
server/schedulers/hot_test.go
Outdated
} | ||
} | ||
|
||
// heartbeat twice for read stat in order to let hot degree become 3 |
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.
heartbeat twice?
db00b75
to
a025e39
Compare
server/statistics/hot_cache.go
Outdated
flowQueue chan *core.RegionInfo | ||
writeFlow *hotPeerCache | ||
readFlow *hotPeerCache | ||
writeFlowQueue chan *core.PeerInfo |
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.
how about [rwType] chan *core.PeerInfo
3d80dd9
to
2d911f8
Compare
bce4c3e
to
4aefd03
Compare
Codecov Report
@@ Coverage Diff @@
## master #3665 +/- ##
==========================================
- Coverage 74.84% 74.77% -0.08%
==========================================
Files 244 244
Lines 24209 24291 +82
==========================================
+ Hits 18119 18163 +44
- Misses 4484 4517 +33
- Partials 1606 1611 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
0e5d1c4
to
f20933a
Compare
f20933a
to
a2c277f
Compare
/run-all-tests |
server/cluster/cluster.go
Outdated
// RandHotRegionFromStore randomly picks a hot region in specified store. | ||
func (c *RaftCluster) RandHotRegionFromStore(store uint64, kind statistics.FlowKind) *core.RegionInfo { | ||
// HotRegionsFromStore picks hot regions in specified store. | ||
func (c *RaftCluster) HotRegionsFromStore(store uint64, kind statistics.FlowKind) []*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.
Where do we use it?
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.
Only be used for mockCluster, removed.
server/statistics/hot_peer_cache.go
Outdated
// CheckRegionFlow checks the flow information of region. | ||
func (f *hotPeerCache) CheckRegionFlow(region *core.RegionInfo) (ret []*HotPeerStat) { | ||
// it is only used for test. |
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?
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.
Only mockcluster used it for test now.
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.
CheckReadLeaderSync also uses it?
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 better to remove Check...Sync
.
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 think we can't remove Check...Sync
, Check....Async
isn't friendly enough to be used in unit-test.
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.
CheckRegionFlow
now is removed and the related logic is ported in mockCluster
.
server/cluster/cluster.go
Outdated
@@ -681,6 +713,9 @@ func (c *RaftCluster) processRegionHeartbeat(region *core.RegionInfo) error { | |||
if c.regionStats != nil { | |||
c.regionStats.Observe(region, c.getRegionStoresLocked(region)) | |||
} | |||
for _, item := range expiredItems { | |||
c.hotStat.Update(item) |
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 have a problem since there is another place that may update at the same time?
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.
fixed.
Signed-off-by: yisaer <disxiaofei@163.com>
* Clean up useless parameters Signed-off-by: JmPotato <ghzpotato@gmail.com> * Define some const variables Signed-off-by: JmPotato <ghzpotato@gmail.com> Co-authored-by: ShuNing <nolouch@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
* Update to TiDB Dashboard v2021.04.16.1 Signed-off-by: Suhaha <jklopsdfw@gmail.com> * Update to TiDB Dashboard v2021.05.12.1 Signed-off-by: Suhaha <jklopsdfw@gmail.com> Co-authored-by: 混沌DM <hundundm@gmail.com>
Signed-off-by: yisaer <disxiaofei@163.com>
ed8cab7
to
c244213
Compare
/run-unit-test |
Signed-off-by: yisaer <disxiaofei@163.com>
591bd2d
to
55cff6f
Compare
Signed-off-by: yisaer <disxiaofei@163.com>
5ecebae
to
883ff39
Compare
/run-unit-test |
/run-build |
[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: 1576704
|
SonarCloud Quality Gate failed. 0 Bugs No Coverage information |
Signed-off-by: yisaer disxiaofei@163.com
What problem does this PR solve?
What is changed and how it works?
Support receiving read info of hot peer stat from store heartbeat.
Check List
Tests
Release note