-
Notifications
You must be signed in to change notification settings - Fork 726
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
Adjust the store limit according to the cluster state dynamically #1902
Conversation
/run-all-tests |
6e7f819
to
a776c31
Compare
a776c31
to
5afb7ba
Compare
Codecov Report
@@ Coverage Diff @@
## master #1902 +/- ##
==========================================
- Coverage 76.79% 76.75% -0.05%
==========================================
Files 186 188 +2
Lines 19049 19162 +113
==========================================
+ Hits 14628 14707 +79
- Misses 3305 3335 +30
- Partials 1116 1120 +4
Continue to review full report at Codecov.
|
6f956f8
to
5ae3c34
Compare
55d1677
to
c767ec4
Compare
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
state Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
The store limit is wrapped by a struct called StoreLimit, it exports the useful api of the ratelimit.Bucket. It records the limit's setting mode which can be "auto" or "manual". An "manual" set value can overwrite an "auto set value, otherwise it is forbidden. Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
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. Do we need to add a simple comparison test result under this PR?
Do you have any ideas about the test? |
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
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
/run-all-tests |
/run-all-tests |
@shafreeck merge failed. |
/run-all-tests |
1 similar comment
/run-all-tests |
/merge |
/run-all-tests |
@shafreeck merge failed. |
/merge |
/run-all-tests |
@shafreeck merge failed. |
/run-all-tests |
Notice: This PR only could be merged after #1875 and #1887What problem does this PR solve?
Adjust the store limit according to the cluster state dynamically
One of the main job of PD is to keep the data balanced on all TiKV nodes. The scheduler in PD moves regions between TiKVs when the unbalance is detected. In the case of adding or removing a TiKV node, the unbalance occurs, and the scheduler tries to move a lot amount of data. To avoid overloading a TiKV node, PD limits the speed to move regions for each TiKV node, the strategy is called store-limit.
The store-limit is a fixed value which is 15 regions per minute by default. This value is conservative, it prevents the TiKV from overloading in almost all cases. However, the value is too low for an idle cluster which may have no or little load. It takes too much time to balance the data when adding or removing a node. This PR tries to solve this problem by introducing the measurement of cluster state and adjust the store-limit dynamically according to the cluster state.
What is changed and how it works?
StoreLimitScene
is added for configuring the store-limit for different states, the valid states could be: idle, low, normal, high. The configuration can be updated by the HTTP API or pd-ctl.store limit-scene [<scene> <rate>]
Check List
Tests
Code changes
Related changes