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

Add batch split #6

Merged
merged 15 commits into from
Dec 20, 2018
Prev Previous commit
Next Next commit
address comment
Signed-off-by: Connor1996 <[email protected]>
  • Loading branch information
Connor1996 committed Oct 30, 2018
commit 8e6e69884f4549a7deb1ae9826331c4e597d440e
12 changes: 6 additions & 6 deletions text/2018-10-25-batch-split.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Summary

Support `BatchSplit` feature that split one Region into multiple Regions at a time if the size is large enough. This includes modifications of both TiKV and PD. For TiKV, every round of split-check produces multiple split keys instead of one and change inner split related interface into batch style. For PD, add RPC `AskBatchSplit` and `ReportBatchSplit` to permit TiKV asking for `region_id` and `peer_id` in batch.
Support `BatchSplit` feature that split one Region into multiple Regions at a time if the size or the number of keys exceeds a threshold. This includes modifications of both TiKV and PD. For TiKV, every round of split-check produces multiple split keys instead of one and change inner split related interface into batch style. For PD, add RPC `AskBatchSplit` and `ReportBatchSplit` to permit TiKV asking for `region_id` and `peer_id` in batch.
Connor1996 marked this conversation as resolved.
Show resolved Hide resolved

# Motivation

Expand All @@ -14,7 +14,7 @@ Current split only split one Region at a time. It may be very slow when sequenti

```protobuf
service PD {
// ...
// ...

rpc AskSplit(AskSplitRequest) returns (AskSplitResponse) {
// Use AskBatchSplit instead.
Expand All @@ -36,7 +36,7 @@ message AskBatchSplitRequest {

message SplitID {
uint64 new_region_id = 1;
repeated uint64 new_peer_ids = 2;
repeated uint64 new_peer_ids = 2;
}

message AskBatchSplitResponse {
Expand All @@ -46,11 +46,11 @@ message AskBatchSplitResponse {

message ReportBatchSplitRequest {
RequestHeader header = 1;
repeated metapb.Region regions = 2;
repeated metapb.Region regions = 2;
}

message ReportBatchSplitResponse {
ResponseHeader header = 1;
ResponseHeader header = 1;
}
```

Expand Down Expand Up @@ -158,7 +158,7 @@ So if the size of Region is larger than `region_max_size * batch_split_limit * 2

# Drawbacks

- When use approximate way, Region may split into several disproportion Regions due to size estimation.
- When use approximate way, Region may split into several disproportional Regions due to size estimation.
Connor1996 marked this conversation as resolved.
Show resolved Hide resolved

# Alternatives

Expand Down