Skip to content

Commit

Permalink
store/tikv: limit batch split count for one request (#18191) (#18694)
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
  • Loading branch information
ti-srebot committed Jul 24, 2020
1 parent 459787a commit bf298cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion store/tikv/split_region.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit bf298cc

Please sign in to comment.