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

*: add new region score formula #3269

Merged
merged 5 commits into from
Dec 15, 2020
Merged

Conversation

disksing
Copy link
Contributor

@disksing disksing commented Dec 14, 2020

Signed-off-by: disksing i@disksing.com

What problem does this PR solve?

Make region score grow smoother and less affected by available changes.

What is changed and how it works?

  • introduce new formula (v2)
  • add config to control formula version
  • add test

Default formula for newly created clusters is "v2", all old clusters keeps "v1" unless set manually.

The test result shows that compared to v4.0.7, the new formula can help balance fast to converge and more stable even with a very high store limit configuration.

Check List

Tests

  • Unit test

Related Issue

Release note

  • Introduce new region score formula

Signed-off-by: disksing <i@disksing.com>
@disksing disksing added type/enhancement The issue or PR belongs to an enhancement. component/scheduler Scheduler logic. labels Dec 14, 2020
@codecov
Copy link

codecov bot commented Dec 14, 2020

Codecov Report

Merging #3269 (186cc85) into master (16005cf) will decrease coverage by 0.04%.
The diff coverage is 95.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3269      +/-   ##
==========================================
- Coverage   73.90%   73.85%   -0.05%     
==========================================
  Files         242      242              
  Lines       23004    23029      +25     
==========================================
+ Hits        17001    17009       +8     
- Misses       4426     4431       +5     
- Partials     1577     1589      +12     
Flag Coverage Δ
unittests 73.85% <95.65%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/core/store.go 81.93% <90.90%> (+1.27%) ⬆️
pkg/mock/mockcluster/config.go 100.00% <100.00%> (ø)
server/api/config.go 65.87% <100.00%> (ø)
server/api/store.go 62.26% <100.00%> (ø)
server/config/config.go 74.41% <100.00%> (+0.10%) ⬆️
server/config/persist_options.go 91.33% <100.00%> (+0.03%) ⬆️
server/config/util.go 90.90% <100.00%> (ø)
server/schedule/filter/comparer.go 100.00% <100.00%> (ø)
server/schedulers/balance_region.go 85.84% <100.00%> (ø)
server/schedulers/utils.go 93.05% <100.00%> (+0.30%) ⬆️
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 16005cf...186cc85. Read the comment docs.

Signed-off-by: disksing <i@disksing.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 15, 2020
@disksing disksing requested a review from lhy1024 December 15, 2020 04:23
Copy link
Contributor

@lhy1024 lhy1024 left a 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 some test result in this pr desc?

Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 15, 2020
@disksing
Copy link
Contributor Author

LGTM, do we need to add some test result in this pr desc?

ok, I'll add a short description.

@disksing disksing added the status/can-merge Indicates a PR has been approved by a committer. label Dec 15, 2020
@disksing
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot ti-chi-bot merged commit 0ea4713 into tikv:master Dec 15, 2020
@disksing disksing deleted the region-score branch December 15, 2020 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/scheduler Scheduler logic. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants