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

raftstore/coprocessor: use scan way when approximate way fail #3942

Merged
merged 4 commits into from Dec 18, 2018

Conversation

Projects
None yet
3 participants
@Connor1996
Copy link
Member

Connor1996 commented Dec 17, 2018

What have you changed? (mandatory)

use scan way when approximate way fail and add some check

What are the type of the changes? (mandatory)

Bug fix (non-breaking change which fixes an issue)

How has this PR been tested? (mandatory)

unit-test

Does this PR affect documentation (docs) update? (mandatory)

No

Does this PR affect tidb-ansible update? (mandatory)

No

fix split panic
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
clean
Signed-off-by: Connor1996 <zbk602423539@gmail.com>

@Connor1996 Connor1996 force-pushed the Connor1996:fix-split branch from b3822d1 to d0a435b Dec 17, 2018

change log
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Show resolved Hide resolved src/raftstore/store/worker/split_check.rs Outdated
Show resolved Hide resolved src/raftstore/store/worker/split_check.rs Outdated
Show resolved Hide resolved src/raftstore/store/worker/split_check.rs Outdated
@@ -544,15 +547,35 @@ pub fn get_region_approximate_split_keys_cf(
if keys.len() == 1 {
return Ok(vec![]);
}
if keys.is_empty() || total_size == 0 || split_size == 0 {

This comment has been minimized.

Copy link
@huachaohuang

huachaohuang Dec 17, 2018

Contributor

Maybe just log when n == 0 and combine all the information there?

This comment has been minimized.

Copy link
@Connor1996

Connor1996 Dec 17, 2018

Author Member

Divided by zero may cause panic too, so we should check it before we can know whether n == 0

address comment
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
@huachaohuang
Copy link
Contributor

huachaohuang left a comment

LGTM

@zhangjinpeng1987
Copy link
Member

zhangjinpeng1987 left a comment

LGTM

@zhangjinpeng1987 zhangjinpeng1987 merged commit 592c083 into tikv:master Dec 18, 2018

4 checks passed

DCO All commits are signed off!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
idc-jenkins-ci/build Jenkins job succeeded.
Details
jenkins-ci-tikv/build Jenkins job succeeded.
Details

@Connor1996 Connor1996 deleted the Connor1996:fix-split branch Dec 18, 2018

Connor1996 added a commit to Connor1996/tikv that referenced this pull request Dec 18, 2018

Connor1996 added a commit to Connor1996/tikv that referenced this pull request Dec 18, 2018

raftstore/coprocessor: use scan way when approximate way fail (tikv#3942
)

Signed-off-by: Connor1996 <zbk602423539@gmail.com>

Connor1996 added a commit that referenced this pull request Dec 18, 2018

raftstore/coprocessor: use scan way when approximate way fail (#3942) (
…#3933)

Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.