-
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
coordinator: use a healthy region count to start coordinator #7044
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. |
Skipping CI for Draft Pull Request. |
c5d8bcf
to
31e8d61
Compare
31e8d61
to
eb8db24
Compare
d34b261
to
4b862b9
Compare
4b862b9
to
accb06b
Compare
pkg/core/region.go
Outdated
|
||
const ( | ||
// InDisk means region is stale. | ||
InDisk RegionSource = iota |
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 FromLoad or FromStorage?
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.
update to FromStorage
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Codecov Report
@@ Coverage Diff @@
## master #7044 +/- ##
==========================================
+ Coverage 74.62% 74.69% +0.07%
==========================================
Files 442 442
Lines 47660 47681 +21
==========================================
+ Hits 35565 35615 +50
+ Misses 8972 8947 -25
+ Partials 3123 3119 -4
Flags with carried forward coverage won't be shown. Click here to find out more. |
Signed-off-by: husharp <jinhao.hu@pingcap.com>
18353dc
to
6be6f17
Compare
Signed-off-by: husharp <ihusharp@gmail.com>
pkg/core/region_tree.go
Outdated
@@ -342,3 +346,20 @@ func (t *regionTree) TotalWriteRate() (bytesRate, keysRate float64) { | |||
} | |||
return t.totalWriteBytesRate, t.totalWriteKeysRate | |||
} | |||
|
|||
func (t *regionTree) AtomicAddStaleRegionCnt() { | |||
if t.length() == 0 { |
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 do we need to check the length here?
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.
Now we do not need to check it after moving staleRegionCnt
into regionsInfo
pkg/schedule/prepare_checker.go
Outdated
log.Info("stale meta region number is satisfied, skip prepare checker", zap.Int64("stale-region", c.GetStaleRegionCnt()), zap.Int("total-region", c.GetTotalRegionCount())) | ||
checker.prepared = true | ||
return true | ||
} | ||
// The number of active regions should be more than total region of all stores * collectFactor | ||
if float64(c.GetTotalRegionCount())*collectFactor > float64(checker.sum) { |
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.
Do we still need 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.
maybe it is better to remove them in another pr? This pr just focuses on accelerating coordinator.
What do u think :)
pkg/core/region.go
Outdated
// FromStorage means this region's meta info might be stale. | ||
r.AtomicAddStaleRegionCnt() |
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.
Here we need to make sure that only reload from storage will use CheckAndPutRegion
.
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 by return regions num
pkg/core/region.go
Outdated
) | ||
|
||
// IsSourceStale means this region's meta info might be stale. | ||
func (r *RegionInfo) IsSourceStale() bool { |
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 not using stale/fresh? Just use LoadedFromStorage
and !LoadedFromStorage
. Or something like that.
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: husharp <jinhao.hu@pingcap.com>
9574d70
to
6281684
Compare
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
/merge |
@nolouch: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
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: 6281684
|
@HuSharp: Your PR was out of date, I have automatically updated it for you. If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. 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. |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: Close #6988 ,Close #7016
What is changed and how does it work?
FromSync
andFromStorage
as the stale regionCheck List
Tests
Release note