-
Notifications
You must be signed in to change notification settings - Fork 759
coordinator: use a healthy region count to start coordinator #7044
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
Merged
Merged
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
accb06b
fix
HuSharp 46406e7
Merge branch 'master' into fix_coordinator
HuSharp d161acb
address comment
HuSharp 6be6f17
address comment
HuSharp 1f16cda
Merge remote-tracking branch 'upstream/master' into fix_coordinator
HuSharp 68a1107
address comment
HuSharp c67ed32
Merge remote-tracking branch 'upstream/master' into fix_coordinator
HuSharp 67b4081
address comment
HuSharp 7bae37c
change to healthy region and move to region tree
HuSharp 382816d
Merge remote-tracking branch 'upstream/master' into fix_coordinator
HuSharp f89619a
add test
HuSharp 4eebfe3
merge master
HuSharp e90fa56
remove redundant line
HuSharp cc2d832
merge master
HuSharp 664427a
merge master
HuSharp 8a0c520
follower to leader can start coordinator immediately
HuSharp c88260d
Merge branch 'master' into fix_coordinator
HuSharp 32f856f
Merge branch 'master' into fix_coordinator
HuSharp be7296f
Merge branch 'master' into fix_coordinator
HuSharp 99dc596
Merge remote-tracking branch 'upstream/master' into fix_coordinator
HuSharp 0663294
change to from
HuSharp 183649a
change proper name
HuSharp 45d2cc5
Merge branch 'master' into fix_coordinator
HuSharp 6281684
address comment
HuSharp a9d6e3e
Merge branch 'master' into fix_coordinator
ti-chi-bot[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,8 +17,10 @@ package schedule | |
| import ( | ||
| "time" | ||
|
|
||
| "github.com/pingcap/log" | ||
| "github.com/tikv/pd/pkg/core" | ||
| "github.com/tikv/pd/pkg/utils/syncutil" | ||
| "go.uber.org/zap" | ||
| ) | ||
|
|
||
| type prepareChecker struct { | ||
|
|
@@ -47,6 +49,11 @@ func (checker *prepareChecker) check(c *core.BasicCluster) bool { | |
| checker.prepared = true | ||
| return true | ||
| } | ||
| if float64(c.GetClusterHealthyRegionsCnt()) > float64(c.GetTotalRegionCount())*collectFactor { | ||
| log.Info("healthy meta region number is satisfied, finish prepare checker", zap.Int64("healthy-region", c.GetClusterHealthyRegionsCnt()), 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) { | ||
|
||
| return false | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
LoadedFromStorageand!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