-
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
server/coordinator: startup schedulers with considering the proportion of regions #1225
Conversation
…n of regions activated on each store
server/core/region.go
Outdated
@@ -486,10 +486,6 @@ func (r *RegionsInfo) AddRegion(region *RegionInfo) []*metapb.Region { | |||
|
|||
r.regions.Put(region) | |||
|
|||
if region.Leader == 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.
It seems that it cannot be removed because it might be use in region.Leader.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.
It not illegal.
em, have you run a cluster to manually test 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.
LGTM.
I do 2 cases with the manual test. One is simulator 200 stores and Isolate the network of PD and a TiKV, then restart the PD and the coordinator will not start until timeout. Another with 4 stores and isolate a store then restart the PD, the coordinator will start because the heartbeat can be completely collected by the new leaders. |
…n of regions activated on each store
What problem does this PR solve?
If we have many stores, like 10 stores, and restart the cluster. 9 stores already reported a heartbeat and the last not finished. the schedulers will begin to schedule and do some unnecessary balance.
What is changed and how it works?
This PR startup schedulers with considering the proportion of regions activated on each store.
Check List
Tests