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

*: refactor split check #2440

Merged
merged 38 commits into from Nov 2, 2017
Merged

*: refactor split check #2440

merged 38 commits into from Nov 2, 2017

Conversation

overvenus
Copy link
Member

Move size split check from SplitCheckRunner to CoprocessorHost. It also move region-max-size and region-split-size to coprocessor configuration.

Ref #2378

@@ -73,6 +71,10 @@ raft-store-max-leader-lease = "12s"
right-derive-when-split = false
allow-remove-leader = true

[coprocessor]
region-max-size = "12MB"
Copy link
Contributor

Choose a reason for hiding this comment

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

@LinuxGit

Do we need to update ansible?

@siddontang
Copy link
Contributor

No need to support compatible config file.

[coprocessor]
# When it is true, it will try to split a region with table prefix if
# that region crosses tables.
# split-region-on-table = false
Copy link
Member

Choose a reason for hiding this comment

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

Stale comment.

# When the region's size exceeds region-max-size, we will split the region
# into two which the left region's size will be region-split-size or a little
# bit smaller.
# region-max-size = "144MB"
Copy link
Member

Choose a reason for hiding this comment

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

If this is set, then coprocessor.region-max-size should be updated too.

@@ -463,6 +463,7 @@ fn main() {
if let Err(e) = config.validate() {
fatal!("invalid configuration: {:?}", e);
}
config.compatible_adjust();
Copy link
Member

Choose a reason for hiding this comment

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

Should adjust before validating.

Copy link
Member

@BusyJay BusyJay left a comment

Choose a reason for hiding this comment

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

rest LGTM

@@ -202,6 +200,15 @@ impl Config {
));
}

// Compatibility check.
if self.region_max_size.0 != 0 {
warn!("raftstore.region-max-size has been moved to coprocessor");
Copy link
Member

Choose a reason for hiding this comment

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

This is unreachable.

@@ -195,7 +195,7 @@ pub fn data_key(key: &[u8]) -> Vec<u8> {
}

pub fn origin_key(key: &[u8]) -> &[u8] {
assert!(validate_data_key(key));
assert!(validate_data_key(key), "invalid data key {:?}", key);
Copy link
Member

Choose a reason for hiding this comment

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

How about util::escape?

@siddontang
Copy link
Contributor

LGTM

@overvenus
Copy link
Member Author

/run-all-test

@BusyJay
Copy link
Member

BusyJay commented Nov 1, 2017

LGTM

@overvenus
Copy link
Member Author

/run-all-test

@@ -138,6 +133,13 @@
# Interval (s) to check region whether the data are consistent.
# consistency-check-interval = 0

[coprocessor]
Copy link
Member

Choose a reason for hiding this comment

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

I think this will confuse ops.

@overvenus overvenus merged commit 1084f94 into tikv:master Nov 2, 2017
@overvenus overvenus deleted the split-table-part1 branch November 2, 2017 05:13
@overvenus overvenus restored the split-table-part1 branch November 2, 2017 05:16
@overvenus overvenus deleted the split-table-part1 branch November 2, 2017 06:53
sticnarf pushed a commit to sticnarf/tikv that referenced this pull request Oct 27, 2019
Move size split check from SplitCheckRunner to CoprocessorHost.
It also move region-max-size and region-split-size to coprocessor
configuration.

Ref tikv#2378
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants