Skip to content

Commit 89b76f4

Browse files
committed
gramma
Signed-off-by: bufferflies <1045931706@qq.com>
1 parent 6da63b8 commit 89b76f4

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

text/0083-Improve-the-robust-of-balance-scheduler.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,40 @@
55

66
## Summary
77

8-
Make scheduler more robust for dynamic region size.
8+
Make schedulers more robust for dynamic region size.
99

1010
## Motivation
1111

12-
We have observed many different situations when the region size is different. The major drawback comes from this aspects:
12+
We have observed many different situations when the region size is different. The major drawback comes from these aspects:
1313

14-
1. Balance region scheduler pick source store in order of store's score, the second store will be picked after the first store has not met some filter or retry times exceed fixed value, this problem is also exist in target pick strategy.
15-
2. Operator has an import effect on region leader, and the leader is responsible in the operator life cycle. But the region leader will not be limited by any filter.
16-
3. There are some factor that influence execution time of operator such as region size, IO limit, cpu load. PD needs to be more flexible to manage operator's life not fixed config.
14+
1. Balance region scheduler picks source store in order of store's score, the lower store will be picked after the higher store has not met some filter or retry times exceed fixed value. If the count of placement rules or tikv is bigger, the lower store has less chance to balance like TiFlash.
15+
2. splitting rocksDB and sending them by region leader will occupy cpu and io resources.
16+
3. There are some factors that influence execution time of an operator such as region size, IO limit, cpu load. PD needs to be more flexible to manage operator's timeout threshold rather than not fixed value.
1717
4. PD should know some global config about TiKV like `region-max-size`, `region-report-interval`. This config should synchronize with PD.
1818

1919
## Detailed design
2020

2121
### Store pick strategy
2222

23-
It can arrange all the store based on label, like TiKV and TiFlash and allow low score group has more chance to scheduler. But the first score region should has highest priority to be selected.
23+
It can arrange all the stores based on label, like TiKV and TiFlash and allow low score groups more chances to schedule. But the first score region should have the highest priority to be selected.
2424

2525
#### Consider Influence to leader
2626

27-
Normally, one operator is made of region, source store and target store, the key works finished by region leader such as snapshot generate, snapshot send. It is not friendly to the leader if majority operator is add follow.
28-
29-
It will add new store limit as new limit type to decrease leader loads of every store.
27+
It will add a new store limit to decrease leader loads of every store. Picking region should check if the leader token is available.
3028

3129
### Operator control
3230

3331
#### Store limit cost
3432

35-
Different size region occupy tokens should be different. Maybe can use this formula:
33+
Different size regions occupy tokens should be different. Maybe can use this formula:
3634

3735
![](https://latex.codecogs.com/gif.image?\dpi{200}&space;\bg_white&space;Influence=\sum_{i=0}^{j}step_{i}.Influence&space;\newline&space;Cost&space;=&space;200*ln{\frac{region_{size}}{100KiB}})
3836

39-
Cost equals 200 if operator influence is 1Mb or equals 600 if operator influence is 1gb.
37+
Cost equals 200 if operator influence is 1MB or equals 600 if operator influence is 1GB.
4038

4139
#### Operator life cycle
4240

43-
The operator life cycle can divide into some stages: create, executing(started), complete. PD will check operator stage by region heart beats and cancel operator if one operator‘s running time exceed the fixed value(10m).
41+
The operator life cycle can be divided into some stages: create, executing(started), complete. PD will check operator stage by region heartbeat and cancel if one operator‘s running time exceeds the fixed value(10m).
4442

4543
It will be better if we can calculate every step expecting execute duration by major factor includes region size, IO limit and operator concurrency like this:
4644

@@ -56,9 +54,9 @@ There are some global config that all components need to synchronize like `regio
5654

5755
## Alternatives
5856

59-
Removing peer may not influence the cluster performance, it can be replace by leader store limit.
57+
Removing peer may not influence the cluster performance, it can be replaced by leader store limit.
6058

61-
Canceling operator can depends on TiKV not by PD, but TiKV should notify PD after canceled one operator.
59+
Canceling operators can depend on TiKV not by PD, but TiKV should notify PD after canceling one operator.
6260

6361
## Questions
6462

0 commit comments

Comments
 (0)