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

*: support a region divided into multiple regions #11739

Merged
merged 15 commits into from Sep 3, 2019

Conversation

@zimulala
Copy link
Member

commented Aug 14, 2019

What problem does this PR solve?

Serial splitting and scattering regions take a long time.
Related to pingcap/kvproto#440, tikv/tikv#5268

What is changed and how it works?

If some split keys in a region, we can batch split these keys. Then we can split a region into several regions in a request. And we split of different regions in parallel.

Check List

Tests

  • No code

Code changes

  • Has exported function/method change
  • Has interface methods change
@codecov

This comment has been minimized.

Copy link

commented Aug 22, 2019

Codecov Report

Merging #11739 into master will increase coverage by 0.0045%.
The diff coverage is 72.8915%.

@@               Coverage Diff                @@
##             master     #11739        +/-   ##
================================================
+ Coverage   81.3475%   81.3521%   +0.0045%     
================================================
  Files           444        444                
  Lines         95103      95180        +77     
================================================
+ Hits          77364      77431        +67     
- Misses        12233      12246        +13     
+ Partials       5506       5503         -3
@zimulala

This comment has been minimized.

Copy link
Member Author

commented Aug 22, 2019

@zimulala

This comment has been minimized.

Copy link
Member Author

commented Aug 23, 2019

@winkyao

This comment has been minimized.

Copy link
Member

commented Aug 24, 2019

@zimulala Please give some results of performance improvement

if len(regionIDs) == 1 {
return regionIDs[0]
}
return 0

This comment has been minimized.

Copy link
@winkyao

winkyao Aug 24, 2019

Member

Shall we return an error here?

This comment has been minimized.

Copy link
@zimulala

zimulala Aug 27, 2019

Author Member

It's the original code and several functions on the upper layer also did not return an error message.

store/tikv/split_region.go Outdated Show resolved Hide resolved
store/tikv/split_region.go Outdated Show resolved Hide resolved
store/tikv/split_region.go Outdated Show resolved Hide resolved
zimulala added 3 commits Aug 27, 2019
@zimulala

This comment has been minimized.

Copy link
Member Author

commented Aug 30, 2019

@crazycs520
Copy link
Contributor

left a comment

LGTM

}
regionIDs = append(regionIDs, regionID)

regionIDs, err := s.SplitRegions(context.Background(), splitIdxKeys, true)

This comment has been minimized.

Copy link
@bb7133

bb7133 Aug 30, 2019

Contributor

Why not using ctxWithTimeout here? IMHO a timeout is still needed

This comment has been minimized.

Copy link
@zimulala

zimulala Aug 30, 2019

Author Member

The original code hasn't and SplitRegions has itself timeout, so I don't add it.
If you feel the need, is there a suggested value?

This comment has been minimized.

Copy link
@bb7133

bb7133 Sep 2, 2019

Contributor

OK, never mind

store/tikv/split_region.go Outdated Show resolved Hide resolved
store/tikv/split_region.go Outdated Show resolved Hide resolved
store/tikv/split_region.go Outdated Show resolved Hide resolved
store/tikv/split_region.go Outdated Show resolved Hide resolved
store/tikv/split_region.go Outdated Show resolved Hide resolved
@winkyao
Copy link
Member

left a comment

LGTM

@zimulala zimulala added status/LGT2 and removed status/LGT1 labels Sep 2, 2019

@bb7133
Copy link
Contributor

left a comment

LGTM

@sre-bot

This comment has been minimized.

Copy link

commented Sep 2, 2019

/run-all-tests

@sre-bot

This comment has been minimized.

Copy link

commented Sep 2, 2019

@zimulala merge failed.

@zimulala

This comment has been minimized.

Copy link
Member Author

commented Sep 2, 2019

/run-integration-common-test

@zimulala zimulala force-pushed the zimulala:split-resions branch from 12242a1 to 6c38a18 Sep 3, 2019

@zimulala

This comment has been minimized.

Copy link
Member Author

commented Sep 3, 2019

/run-all-tests

@zimulala zimulala merged commit f9d8541 into pingcap:master Sep 3, 2019

15 checks passed

codecov/patch 72.8915% of diff hit (target 0%)
Details
codecov/project 81.3521% (+0.0045%) compared to 06fc28f
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/build_check_race Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev_2 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/common-test job succeeded
Details
idc-jenkins-ci-tidb/integration-common-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-compatibility-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-ddl-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/mybatis-test job succeeded
Details
idc-jenkins-ci-tidb/sqllogic-test-1 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/sqllogic-test-2 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@zimulala zimulala deleted the zimulala:split-resions branch Sep 3, 2019

@sre-bot

This comment has been minimized.

Copy link

commented Sep 3, 2019

cherry pick to release-3.0 failed

@sre-bot

This comment has been minimized.

Copy link

commented Sep 3, 2019

cherry pick to release-2.1 failed

jingyugao added a commit to jingyugao/tidb that referenced this pull request Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.