@@ -18,6 +18,7 @@ import (
18
18
"github.com/pingcap/kvproto/pkg/pdpb"
19
19
"github.com/pingcap/log"
20
20
berrors "github.com/pingcap/tidb/br/pkg/errors"
21
+ "github.com/pingcap/tidb/br/pkg/lightning/common"
21
22
"github.com/pingcap/tidb/br/pkg/logutil"
22
23
"github.com/pingcap/tidb/br/pkg/restore/split"
23
24
"github.com/pingcap/tidb/br/pkg/rtree"
@@ -194,6 +195,10 @@ func (rs *RegionSplitter) hasHealthyRegion(ctx context.Context, regionID uint64)
194
195
func (rs * RegionSplitter ) isScatterRegionFinished (ctx context.Context , regionID uint64 ) (bool , bool , error ) {
195
196
resp , err := rs .client .GetOperator (ctx , regionID )
196
197
if err != nil {
198
+ if common .IsRetryableError (err ) {
199
+ // retry in the next cycle
200
+ return false , false , nil
201
+ }
197
202
return false , false , errors .Trace (err )
198
203
}
199
204
// Heartbeat may not be sent to PD
@@ -270,7 +275,7 @@ func (rs *RegionSplitter) WaitForScatterRegions(ctx context.Context, regionInfos
270
275
ok , rescatter , err := rs .isScatterRegionFinished (ctx1 , regionID )
271
276
if err != nil {
272
277
log .Warn ("scatter region failed: do not have the region" ,
273
- logutil .Region (regionInfo .Region ))
278
+ logutil .Region (regionInfo .Region ), zap . Error ( err ) )
274
279
delete (leftRegions , regionID )
275
280
continue
276
281
}
0 commit comments