Skip to content

Commit

Permalink
tikv: fix out-of-index in split-region (#12265) (#13092)
Browse files Browse the repository at this point in the history
  • Loading branch information
lysu authored and sre-bot committed Nov 4, 2019
1 parent 8a19ab5 commit 7939e6f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion store/tikv/split_region.go
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/pingcap/tidb/store/tikv/tikvrpc"
"github.com/pingcap/tidb/util"
"github.com/pingcap/tidb/util/logutil"
"github.com/pingcap/tidb/util/stringutil"
"go.uber.org/zap"
)

Expand Down Expand Up @@ -153,7 +154,12 @@ func (s *tikvStore) batchSendSingleRegion(bo *Backoffer, batch batch, scatter bo
logutil.Logger(context.Background()).Info("batch split regions complete",
zap.Uint64("batch region ID", batch.regionID.id),
zap.Binary("first at", batch.keys[0]),
zap.Stringer("first new region left", spResp.Regions[0]),
zap.Stringer("first new region left", stringutil.MemoizeStr(func() string {
if len(spResp.Regions) == 0 {
return ""
}
return spResp.Regions[0].String()
})),
zap.Int("new region count", len(spResp.Regions)))

if !scatter {
Expand Down

0 comments on commit 7939e6f

Please sign in to comment.