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

core: change score calculator in few disk space to avoid offline earlier (#3592) #3605

Merged
merged 3 commits into from
Apr 16, 2021

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Apr 16, 2021

cherry-pick #3592 to release-5.0
You can switch your code base to this Pull Request by using git-extras:

# In pd repo:
git pr https://github.com/tikv/pd/pull/3605

After apply modifications, you can push your change to this PR via:

git push [email protected]:ti-srebot/pd.git pr/3605:release-5.0-9d9c8eedca3a

What problem does this PR solve?

issue: #3589

What is changed and how it works?

core regionScoreV2 calculator, store's score will increase rapidly when it disk space less than F

Check List

Tests

  • Integration test
  • Manual test (add detailed scripts or steps below)

Code changes
when I use math to consider score similator in low space:
image
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 :
image
image

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.
image

similator result:

image
test result:
image

it work well in low space

Side effects

Related changes

  • Need to cherry-pick to the release branch

Release note

  • modify score calculator to satisfy isomerous stores

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. type/cherry-pick labels Apr 16, 2021
@ti-chi-bot ti-chi-bot removed the status/LGT2 Indicates that a PR has LGTM 2. label Apr 16, 2021
@ti-chi-bot ti-chi-bot requested a review from lhy1024 April 16, 2021 09:53
@ti-srebot ti-srebot added this to the v5.0.1 milestone Apr 16, 2021
@ti-srebot
Copy link
Contributor Author

@HunDunDM you're already a collaborator in bot's repo.

@zhouqiang-cl zhouqiang-cl added the cherry-pick-approved Cherry pick PR approved by release team. label Apr 16, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 16, 2021
@codecov
Copy link

codecov bot commented Apr 16, 2021

Codecov Report

Merging #3605 (151720d) into release-5.0 (3dd3c7b) will decrease coverage by 0.00%.
The diff coverage is 80.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release-5.0    #3605      +/-   ##
===============================================
- Coverage        74.60%   74.60%   -0.01%     
===============================================
  Files              245      245              
  Lines            24122    24124       +2     
===============================================
  Hits             17997    17997              
- Misses            4510     4515       +5     
+ Partials          1615     1612       -3     
Flag Coverage Δ
unittests 74.60% <80.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
server/core/store.go 81.62% <80.00%> (+0.15%) ⬆️
server/kv/etcd_kv.go 79.71% <0.00%> (-5.80%) ⬇️
server/member/member.go 66.84% <0.00%> (-4.35%) ⬇️
server/election/leadership.go 87.05% <0.00%> (-2.36%) ⬇️
pkg/dashboard/adapter/manager.go 82.97% <0.00%> (-2.13%) ⬇️
server/schedulers/utils.go 93.10% <0.00%> (-1.38%) ⬇️
server/tso/allocator_manager.go 74.91% <0.00%> (-1.33%) ⬇️
server/server.go 72.90% <0.00%> (ø)
client/client.go 72.24% <0.00%> (+0.27%) ⬆️
server/grpc_service.go 47.05% <0.00%> (+0.33%) ⬆️
... and 5 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 3dd3c7b...151720d. Read the comment docs.

@nolouch
Copy link
Contributor

nolouch commented Apr 16, 2021

/merge

@ti-chi-bot
Copy link
Member

@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.

@ti-chi-bot
Copy link
Member

@nolouch: /merge in this pull request requires 2 /lgtm.

In response to this:

/merge

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.

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • HunDunDM
  • nolouch

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@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 Apr 16, 2021
@sonarcloud
Copy link

sonarcloud bot commented Apr 16, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@nolouch
Copy link
Contributor

nolouch commented Apr 16, 2021

/merge

@ti-chi-bot
Copy link
Member

@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.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 151720d

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 16, 2021
@nolouch
Copy link
Contributor

nolouch commented Apr 16, 2021

/run-integration-ddl-test

@zhouqiang-cl zhouqiang-cl merged commit ea1449c into tikv:release-5.0 Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants