Skip to content

Commit 348ad44

Browse files
committed
commit some suggestions
Signed-off-by: Leavrth <[email protected]>
1 parent 8c3149a commit 348ad44

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

br/pkg/restore/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ go_library(
3131
"//br/pkg/conn/util",
3232
"//br/pkg/errors",
3333
"//br/pkg/glue",
34+
"//br/pkg/lightning/common",
3435
"//br/pkg/logutil",
3536
"//br/pkg/metautil",
3637
"//br/pkg/pdutil",

br/pkg/restore/split.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/pingcap/kvproto/pkg/pdpb"
1919
"github.com/pingcap/log"
2020
berrors "github.com/pingcap/tidb/br/pkg/errors"
21+
"github.com/pingcap/tidb/br/pkg/lightning/common"
2122
"github.com/pingcap/tidb/br/pkg/logutil"
2223
"github.com/pingcap/tidb/br/pkg/restore/split"
2324
"github.com/pingcap/tidb/br/pkg/rtree"
@@ -194,6 +195,10 @@ func (rs *RegionSplitter) hasHealthyRegion(ctx context.Context, regionID uint64)
194195
func (rs *RegionSplitter) isScatterRegionFinished(ctx context.Context, regionID uint64) (bool, bool, error) {
195196
resp, err := rs.client.GetOperator(ctx, regionID)
196197
if err != nil {
198+
if common.IsRetryableError(err) {
199+
// retry in the next cycle
200+
return false, false, nil
201+
}
197202
return false, false, errors.Trace(err)
198203
}
199204
// Heartbeat may not be sent to PD
@@ -270,7 +275,7 @@ func (rs *RegionSplitter) WaitForScatterRegions(ctx context.Context, regionInfos
270275
ok, rescatter, err := rs.isScatterRegionFinished(ctx1, regionID)
271276
if err != nil {
272277
log.Warn("scatter region failed: do not have the region",
273-
logutil.Region(regionInfo.Region))
278+
logutil.Region(regionInfo.Region), zap.Error(err))
274279
delete(leftRegions, regionID)
275280
continue
276281
}

0 commit comments

Comments
 (0)