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: region initial size depends on the split resource . #15456

Merged
merged 16 commits into from
Sep 4, 2023

Conversation

bufferflies
Copy link
Contributor

@bufferflies bufferflies commented Aug 28, 2023

What is changed and how it works?

Issue Number: Close #15457
depends: pingcap/kvproto#1177
What's Changed:

there are three triggers will split the regions:
1. load split include sizekeys, load etc. In this cases, the new region should contains the data  after split.
2. tidb split tables or partition table, such like `create table test.t1(id int,b int) shard_row_id_bits=4 partition by hash(id) partitions 2000`. 
In this cases , the new region shouldn't contains any data  after split.

Related changes

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
image image

Side effects

Release note

None

Signed-off-by: bufferflies <[email protected]>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 28, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • SpadeA-Tang
  • tonyxuqqi

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/needs-linked-issue labels Aug 28, 2023
Signed-off-by: bufferflies <[email protected]>
Signed-off-by: bufferflies <[email protected]>
@bufferflies bufferflies marked this pull request as ready for review August 29, 2023 05:07
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 29, 2023
Signed-off-by: bufferflies <[email protected]>
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Aug 29, 2023
@bufferflies bufferflies changed the title raftstore: region size depends on the split resource . raftstore: region initial size depends on the split resource . Aug 29, 2023
Signed-off-by: bufferflies <[email protected]>
Signed-off-by: bufferflies <[email protected]>
Signed-off-by: bufferflies <[email protected]>
Signed-off-by: bufferflies <[email protected]>
Signed-off-by: bufferflies <[email protected]>
Signed-off-by: bufferflies <[email protected]>
@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 4, 2023
@@ -75,6 +75,9 @@ pub struct SplitResult {
// The index of the derived region in `regions`
pub derived_index: usize,
pub tablet_index: u64,
// new regions will amortize the region size if it's true.
// otherwise, the new region's size will be 0.
pub amortize_source_region_size: bool,
Copy link
Member

Choose a reason for hiding this comment

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

amortize means gradually write off the initial cost of (an asset) over a period. It's not proper here.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the name can be size_based_split: bool

Copy link
Contributor Author

Choose a reason for hiding this comment

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

has renamed share_source_region_size .

let estimated_keys = control.approximate_keys.map(|v| v / new_region_count);
// if share_source_region_size is true, it means the new region contains any
// data from the origin region.
let mut amortize_size = None;
Copy link
Contributor

Choose a reason for hiding this comment

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

rename these amortize_xxx as well

@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 4, 2023
@bufferflies
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 4, 2023

@bufferflies: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 4, 2023

This pull request has been accepted and is ready to merge.

Commit hash: 47ea9f3

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 4, 2023
@ti-chi-bot ti-chi-bot bot merged commit 640143a into tikv:master Sep 4, 2023
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Sep 4, 2023
@bufferflies bufferflies added needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. labels Sep 5, 2023
ti-chi-bot pushed a commit to ti-chi-bot/tikv that referenced this pull request Sep 5, 2023
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #15509.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #15510.

ti-chi-bot pushed a commit to ti-chi-bot/tikv that referenced this pull request Sep 5, 2023
ti-chi-bot bot pushed a commit that referenced this pull request Sep 6, 2023
… (#15509)

close #15457

there are three triggers will split the regions:
1. load split include sizekeys, load etc. In this cases, the new region should contains the data  after split.
2. tidb split tables or partition table, such like `create table test.t1(id int,b int) shard_row_id_bits=4 partition by hash(id) partitions 2000`. 
In this cases , the new region shouldn't contains any data  after split.

Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: bufferflies <[email protected]>

Co-authored-by: buffer <[email protected]>
Co-authored-by: bufferflies <[email protected]>
bufferflies added a commit to bufferflies/tikv that referenced this pull request Sep 6, 2023
…15456) (tikv#15509)

close tikv#15457

there are three triggers will split the regions:
1. load split include sizekeys, load etc. In this cases, the new region should contains the data  after split.
2. tidb split tables or partition table, such like `create table test.t1(id int,b int) shard_row_id_bits=4 partition by hash(id) partitions 2000`. 
In this cases , the new region shouldn't contains any data  after split.

Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: bufferflies <[email protected]>

Co-authored-by: buffer <[email protected]>
Co-authored-by: bufferflies <[email protected]>
ti-chi-bot bot added a commit that referenced this pull request Sep 13, 2023
… (#15510)

close #15457

there are three triggers will split the regions:
1. load split include sizekeys, load etc. In this cases, the new region should contains the data  after split.
2. tidb split tables or partition table, such like `create table test.t1(id int,b int) shard_row_id_bits=4 partition by hash(id) partitions 2000`. 
In this cases , the new region shouldn't contains any data  after split.

Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: bufferflies <[email protected]>

Co-authored-by: buffer <[email protected]>
Co-authored-by: bufferflies <[email protected]>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

region size maybe not accurate after region split
6 participants