Skip to content
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

Merged
merged 4 commits into from
Sep 5, 2018

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented Aug 30, 2018

…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

  • Unit test

@@ -486,10 +486,6 @@ func (r *RegionsInfo) AddRegion(region *RegionInfo) []*metapb.Region {

r.regions.Put(region)

if region.Leader == nil {
Copy link
Member

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().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It not illegal.

@disksing
Copy link
Contributor

disksing commented Sep 3, 2018

em, have you run a cluster to manually test it?

@disksing
Copy link
Contributor

disksing commented Sep 5, 2018

@nolouch @rleungx Can we push this PR forward now?

Copy link
Member

@rleungx rleungx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@disksing disksing merged commit 832389e into tikv:master Sep 5, 2018
@nolouch nolouch deleted the collect-hb branch September 5, 2018 08:09
@nolouch
Copy link
Contributor Author

nolouch commented Sep 5, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants