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

server: Fix bug for region_score with store's used_size is zero #2471

Merged
merged 4 commits into from
May 28, 2020

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented May 28, 2020

Signed-off-by: JaySon-Huang [email protected]

What problem does this PR solve?

Fix #2470

What is changed and how it works?

If store's used size is zero, just set amplification = 1 to avoid divide by zero error.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Related changes

  • Need to cherry-pick to the release branch

Release note

  • Fix bug that can not get store information when store's used size is zero

@CLAassistant
Copy link

CLAassistant commented May 28, 2020

CLA assistant check
All committers have signed the CLA.

@sre-bot
Copy link
Contributor

sre-bot commented May 28, 2020

@JaySon-Huang JaySon-Huang changed the title core: Fix bug for region_score with store's used_size is zero server: Fix bug for region_score with store's used_size is zero May 28, 2020
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.

Good. Thanks very much.

@rleungx
Copy link
Member

rleungx commented May 28, 2020

@JaySon-Huang Can you tell more about why the used size is 0?

Signed-off-by: JaySon-Huang <[email protected]>
@JaySon-Huang
Copy link
Contributor Author

JaySon-Huang commented May 28, 2020

@rleungx It is detected by a special version of TiFlash, which report zero bytes used with non-zero regions.
I think that even in this situation, PD should not set region score to NaN. Or we can NOT get that store information from API anymore, which may make many other components not work.

@nolouch nolouch added type/bugfix This PR fixes a bug. needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. needs-cherry-pick-release-3.1 The PR needs to cherry pick to release-3.1 branch. labels May 28, 2020
@nolouch
Copy link
Contributor

nolouch commented May 28, 2020

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 28, 2020
@sre-bot
Copy link
Contributor

sre-bot commented May 28, 2020

/run-all-tests

@sre-bot sre-bot merged commit 8b43704 into tikv:master May 28, 2020
@sre-bot
Copy link
Contributor

sre-bot commented May 28, 2020

cherry pick to release-3.1 failed

@sre-bot
Copy link
Contributor

sre-bot commented May 28, 2020

cherry pick to release-4.0 in PR #2474

@JaySon-Huang JaySon-Huang deleted the fix_zero_used_size branch May 28, 2020 12:29
sre-bot pushed a commit that referenced this pull request May 29, 2020
sre-bot added a commit that referenced this pull request May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-3.1 The PR needs to cherry pick to release-3.1 branch. needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. status/can-merge Indicates a PR has been approved by a committer. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If store's used_size is zero, can not get store info from PD
6 participants