-
Notifications
You must be signed in to change notification settings - Fork 742
config: fix the panic caused by zero RegionSplitSizeMB #8324
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
Conversation
@@ -39,24 +39,32 @@ func TestSizeJSON(t *testing.T) { | |||
} | |||
|
|||
func TestParseMbFromText(t *testing.T) { |
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.
If don't use this fix, the new test can still work?
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.
The fix doesn't involve any change to ParseMBFromText
.
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.
got, Do we need to test this fix?
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.
We don't need to because the panic is caused by integer divide by zero
. The added check is sufficient to fix it.
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.
44aa47c
to
f49aa2a
Compare
/hold |
Signed-off-by: JmPotato <ghzpotato@gmail.com>
f49aa2a
to
e21a68a
Compare
/unhold |
@okJiang: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this: 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 kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: HuSharp, niubell, nolouch, okJiang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
In response to a cherrypick label: new pull request created to branch |
close tikv#8323 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
close tikv#8323 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
close tikv#8323 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
close tikv#8323 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
close tikv#8323 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
close #8323 Bypass the case that `RegionSplitSizeMB` might be zero in `(*StoreConfig) CheckRegionSize`. Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io> Signed-off-by: JmPotato <ghzpotato@gmail.com> Co-authored-by: JmPotato <ghzpotato@gmail.com>
close #8323 Bypass the case that `RegionSplitSizeMB` might be zero in `(*StoreConfig) CheckRegionSize`. Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io> Signed-off-by: JmPotato <ghzpotato@gmail.com> Co-authored-by: JmPotato <ghzpotato@gmail.com>
close #8323 Bypass the case that `RegionSplitSizeMB` might be zero in `(*StoreConfig) CheckRegionSize`. Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io> Signed-off-by: JmPotato <ghzpotato@gmail.com> Co-authored-by: JmPotato <ghzpotato@gmail.com>
close #8323 Bypass the case that `RegionSplitSizeMB` might be zero in `(*StoreConfig) CheckRegionSize`. Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io> Signed-off-by: JmPotato <ghzpotato@gmail.com> Co-authored-by: JmPotato <ghzpotato@gmail.com>
close #8323 Bypass the case that `RegionSplitSizeMB` might be zero in `(*StoreConfig) CheckRegionSize`. Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io> Signed-off-by: JmPotato <ghzpotato@gmail.com> Co-authored-by: JmPotato <ghzpotato@gmail.com>
What problem does this PR solve?
Issue Number: close #8323.
What is changed and how does it work?
Check List
Tests
Release note