Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
cherry pick #636 to release-4.0 (#637)
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

Co-authored-by: 3pointer <luancheng@pingcap.com>
  • Loading branch information
ti-srebot and 3pointer authored Dec 14, 2020
1 parent f30cd38 commit 8364c7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/restore/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ SplitRegions:
}
time.Sleep(interval)
if i > 3 {
log.Warn("splitting regions failed, retry it", zap.Error(errSplit), zap.Array("keys", logutil.WrapKeys(keys)))
log.Warn("splitting regions failed, retry it", zap.Error(errSplit), zap.Any("region", region), zap.Array("keys", logutil.WrapKeys(keys)))
}
continue SplitRegions
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/restore/split_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ func (c *pdClient) sendSplitRegionRequest(
var splitErrors error
for i := 0; i < splitRegionMaxRetryTime; i++ {
var peer *metapb.Peer
if regionInfo.Leader != nil {
// scanRegions may return empty Leader in https://github.com/tikv/pd/blob/v4.0.8/server/grpc_service.go#L524
// so wee also need check Leader.Id != 0
if regionInfo.Leader != nil && regionInfo.Leader.Id != 0 {
peer = regionInfo.Leader
} else {
if len(regionInfo.Region.Peers) == 0 {
Expand Down

0 comments on commit 8364c7a

Please sign in to comment.