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

ddl: refine pre-split region logic #11794

Merged
merged 3 commits into from
Aug 20, 2019
Merged

Conversation

crazycs520
Copy link
Contributor

@crazycs520 crazycs520 commented Aug 20, 2019

What problem does this PR solve?

The original logic of pre_split_region will split 2^(pre_split_region -1) regions. It was strange for the user to understand and remember it.

This PR will simply split 2^(pre_split_region) regions when create table with pre_split_region.

What is changed and how it works?

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

Related changes

  • Need to cherry-pick to the release branch

Release Note

  • Change pre_split_regions logic for easy to understand and remember.

@codecov
Copy link

codecov bot commented Aug 20, 2019

Codecov Report

Merging #11794 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #11794   +/-   ##
===========================================
  Coverage   81.4701%   81.4701%           
===========================================
  Files           435        435           
  Lines         93719      93719           
===========================================
  Hits          76353      76353           
  Misses        11891      11891           
  Partials       5475       5475

Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zimulala zimulala added status/LGT2 Indicates that a PR has LGTM 2. needs-cherry-pick-3.0 labels Aug 20, 2019
Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bb7133 bb7133 added status/LGT3 The PR has already had 3 LGTM. status/can-merge Indicates a PR has been approved by a committer. and removed status/LGT2 Indicates that a PR has LGTM 2. labels Aug 20, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Aug 20, 2019

/run-all-tests

@crazycs520
Copy link
Contributor Author

Related docs PR: pingcap/docs-cn#1780

@sre-bot
Copy link
Contributor

sre-bot commented Aug 20, 2019

@crazycs520 merge failed.

@crazycs520
Copy link
Contributor Author

/rebuild

@crazycs520 crazycs520 merged commit 5d88749 into pingcap:master Aug 20, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Aug 20, 2019

cherry pick to release-3.0 in PR #11796

@sre-bot
Copy link
Contributor

sre-bot commented Aug 20, 2019

cherry pick to release-2.1 in PR #11797

@zz-jason
Copy link
Member

@crazycs520 Can we make pre_split_region to be a boolean value? Let shard_row_id_bits to control the number of regions/shards to be split if that option is turned on?

@crazycs520
Copy link
Contributor Author

@zz-jason For the compatibility, not suggest making pre_split_region to be a boolean value.
We plan to add 2 new option: row_id_shard_count , pre_split_region_count, then gradually deprecated pre_split_region and shard_row_id_bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT3 The PR has already had 3 LGTM. type/usability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants