-
Notifications
You must be signed in to change notification settings - Fork 720
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
core: change score calculator in few disk space to avoid offline earlier #3592
Conversation
Signed-off-by: tongjian <1045931706@qq.com> Signed-off-by: tongjian <1045931706@qq.com>
Codecov Report
@@ Coverage Diff @@
## master #3592 +/- ##
==========================================
+ Coverage 74.56% 74.65% +0.09%
==========================================
Files 245 245
Lines 24137 24139 +2
==========================================
+ Hits 17997 18022 +25
+ Misses 4521 4505 -16
+ Partials 1619 1612 -7
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
server/core/store.go
Outdated
@@ -319,7 +320,7 @@ func (s *StoreInfo) regionScoreV2(delta int64, deviation int) float64 { | |||
score = (K + M*(math.Log(C)-math.Log(A-F+1))/(C-A+F-1)) * R | |||
} else { | |||
// When remaining space is less then F, the score is mainly determined by available space. | |||
score = (K+M*math.Log(C)/C)*R + (F-A)*(K+M*math.Log(F)/F) | |||
score = (K+M*math.Log(C)/C)*R + B*(F-A)*(K+M*math.Log(F)/F) |
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.
can we make F configuration and set to a more suitable default value?
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.
What is the relationship between F
and low-space-ratio
? BTW, I think it is a little bit confusing and misleading.
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.
low-space-ratio: avoid other region move in
F: it will increase score after it's free disk less than F, so it will move out region to other
I agree the two args misleading
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.
I use max(20,capacity*(1-lowSpaceRatio)) to set F, so it will eliminate F and low-space-ratio meaning
…the low space store can move regoin to others Signed-off-by: tongjian <1045931706@qq.com>
Signed-off-by: tongjian <1045931706@qq.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
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
/merge |
@nolouch: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: be56b18
|
/run-integration-ddl-test |
/run-integration-compatibility-test |
/run-integration-common-test |
/merge |
@nolouch: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.0 in PR #3605 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
What problem does this PR solve?
issue: #3589
when I use math to consider score similator in low space:
the score will be mostly affect by C, so their socres is different,the lower disk has few score than higher disk. so it will move region to lower store to run out of disk :
similator :
What is changed and how it works?
core regionScoreV2 calculator, store's score will increase rapidly when it disk space less than F.
the F param is not 20G, it should be set by the store's disk space , F will be set:
F=max(50,capacity*(1-lowSpaceRatio))
I want to the score should be similar when they has same free space in low disk space, so use linear calculator.
similator result:
test result:
it work well in low space
Check List
Tests
Code changes
Side effects
Related changes
Release note