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/balancer: add scheduler and simplify schedule configs #396

Merged
merged 7 commits into from
Nov 29, 2016

Conversation

huachaohuang
Copy link
Contributor

The original balance configs are complicated and some of them are very
confusing, now we simplify them to make it more easy to understand.

We replace the concept of "balance" with "schedule". Balance means to
keep the resource balance, but we will introduce different kinds of
strategies in the future which may not balance, and balance is just one
kind of strategies to schedule resources between stores

@huachaohuang huachaohuang changed the title server/balancer: add scheduler and simplefy schedule configs [DNM] server/balancer: add scheduler and simplefy schedule configs Nov 23, 2016
@ngaut ngaut changed the title [DNM] server/balancer: add scheduler and simplefy schedule configs [DNM] server/balancer: add scheduler and simplify schedule configs Nov 23, 2016
@huachaohuang huachaohuang changed the base branch from huachao/cleanup-metrics to develop November 28, 2016 03:19
@huachaohuang huachaohuang changed the title [DNM] server/balancer: add scheduler and simplify schedule configs server/balancer: add scheduler and simplify schedule configs Nov 28, 2016
return 0, nil, nil
}
func (l *leaderBalancer) GetResourceKind() ResourceKind {
return l.kind
Copy link
Contributor

Choose a reason for hiding this comment

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

seem that the kind is fixed for leader and storage balancer, why not returning the const var directly?

I think the score things are too complicated, we can calculate
the scores more easily.
The original balance configs are complicated and some of them are very
confusing, now we simplify them to make it more easy to understand.

We replace the concept of "balance" with "schedule". Balance means to
keep the resource balance, but we will introduce different kinds of
strategies in the future which may not balance, and balance is just one
kind of strategies to schedule resources between stores.
@siddontang
Copy link
Contributor

Cool, LGTM

@huachaohuang
Copy link
Contributor Author

PTAL @overvenus

Copy link
Member

@overvenus overvenus left a comment

Choose a reason for hiding this comment

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

Rest LGTM

func (cf *capacityFilter) FilterSource(store *storeInfo) bool {
return store.storageRatio() <= cf.cfg.MinCapacityUsedRatio
func (f *regionCountFilter) FilterTarget(store *storeInfo) bool {
return false
Copy link
Member

Choose a reason for hiding this comment

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

Why always false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This filter is used to filter source stores with regions fewer than MinRegionCount, it doesn't filter target stores, so it just returns false.

@huachaohuang huachaohuang merged commit d7539eb into develop Nov 29, 2016
huachaohuang added a commit that referenced this pull request Nov 29, 2016
The original balance configs are complicated and some of them are very
confusing, now we simplify them to make it more easy to understand.

We replace the concept of "balance" with "schedule". Balance means to
keep the resource balance, but we will introduce different kinds of
strategies in the future which may not balance, and balance is just one
kind of strategies to schedule resources between stores.
huachaohuang added a commit that referenced this pull request Dec 1, 2016
The original balance configs are complicated and some of them are very
confusing, now we simplify them to make it more easy to understand.

We replace the concept of "balance" with "schedule". Balance means to
keep the resource balance, but we will introduce different kinds of
strategies in the future which may not balance, and balance is just one
kind of strategies to schedule resources between stores.
huachaohuang added a commit that referenced this pull request Dec 7, 2016
The original balance configs are complicated and some of them are very
confusing, now we simplify them to make it more easy to understand.

We replace the concept of "balance" with "schedule". Balance means to
keep the resource balance, but we will introduce different kinds of
strategies in the future which may not balance, and balance is just one
kind of strategies to schedule resources between stores.
@huachaohuang huachaohuang deleted the huachao/scheduler branch December 7, 2016 10:53
huachaohuang added a commit that referenced this pull request Dec 8, 2016
The original balance configs are complicated and some of them are very
confusing, now we simplify them to make it more easy to understand.

We replace the concept of "balance" with "schedule". Balance means to
keep the resource balance, but we will introduce different kinds of
strategies in the future which may not balance, and balance is just one
kind of strategies to schedule resources between stores.
huachaohuang added a commit that referenced this pull request Dec 8, 2016
* server/selector: add selector interface and balance selector (#388)

We can use selector to abstract different strategies to select the
source and target stores.

* server: use selector to schedule region peer (#389)

* server/resource: replace score type with resource kind (#393)

I think the score things are too complicated, we can calculate
the scores more easily.

* server/metrics: remove redundant metrics (#395)

* server/balancer: add scheduler and simplify schedule configs (#396)

The original balance configs are complicated and some of them are very
confusing, now we simplify them to make it more easy to understand.

We replace the concept of "balance" with "schedule". Balance means to
keep the resource balance, but we will introduce different kinds of
strategies in the future which may not balance, and balance is just one
kind of strategies to schedule resources between stores.

* server/coordinator: replace balancer worker with coordinator (#398)

Coordinator can control the speed of different schedulers.

Every scheduler has a unique name, we can add API to run or stop any
schedulers dynamically, and different schedulers can run concurrently.

* server/constraints: add replication constraints (#402)

* server/scheduler: add grant-leader-scheduler (#406)

* server/coordinator: combine scheduler and controller

* server/api: add scheduler api (#407)

We can now use API to list all schedulers, add or remove a scheduler.

* Add shuffle-leader-scheduler (#409)

* server/scheduler: add shuffle-leader-scheduler
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