From c8d51fae082fa0f324663a53102be6db045c3b2b Mon Sep 17 00:00:00 2001 From: Connor Date: Tue, 21 Jul 2020 08:12:01 +0800 Subject: [PATCH] cherry pick #18191 to release-3.0 Signed-off-by: ti-srebot --- store/tikv/split_region.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/store/tikv/split_region.go b/store/tikv/split_region.go index 716196ed2ab0f..43a11ffbd895b 100644 --- a/store/tikv/split_region.go +++ b/store/tikv/split_region.go @@ -31,6 +31,8 @@ import ( "go.uber.org/zap" ) +const splitBatchRegionLimit = 16 + func equalRegionStartKey(key, regionStartKey []byte) bool { if bytes.Equal(key, regionStartKey) { return true @@ -48,7 +50,7 @@ func (s *tikvStore) splitBatchRegionsReq(bo *Backoffer, keys [][]byte, scatter b var batches []batch for regionID, groupKeys := range groups { - batches = appendKeyBatches(batches, regionID, groupKeys, rawBatchPutSize) + batches = appendKeyBatches(batches, regionID, groupKeys, splitBatchRegionLimit) } if len(batches) == 0 {