Skip to content

Commit

Permalink
commit some suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Leavrth <jianjun.liao@outlook.com>
  • Loading branch information
Leavrth committed Nov 2, 2023
1 parent 8c3149a commit 348ad44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions br/pkg/restore/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ go_library(
"//br/pkg/conn/util",
"//br/pkg/errors",
"//br/pkg/glue",
"//br/pkg/lightning/common",
"//br/pkg/logutil",
"//br/pkg/metautil",
"//br/pkg/pdutil",
Expand Down
7 changes: 6 additions & 1 deletion br/pkg/restore/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/pingcap/kvproto/pkg/pdpb"
"github.com/pingcap/log"
berrors "github.com/pingcap/tidb/br/pkg/errors"
"github.com/pingcap/tidb/br/pkg/lightning/common"
"github.com/pingcap/tidb/br/pkg/logutil"
"github.com/pingcap/tidb/br/pkg/restore/split"
"github.com/pingcap/tidb/br/pkg/rtree"
Expand Down Expand Up @@ -194,6 +195,10 @@ func (rs *RegionSplitter) hasHealthyRegion(ctx context.Context, regionID uint64)
func (rs *RegionSplitter) isScatterRegionFinished(ctx context.Context, regionID uint64) (bool, bool, error) {
resp, err := rs.client.GetOperator(ctx, regionID)
if err != nil {
if common.IsRetryableError(err) {
// retry in the next cycle
return false, false, nil
}
return false, false, errors.Trace(err)

Check warning on line 202 in br/pkg/restore/split.go

View check run for this annotation

Codecov / codecov/patch

br/pkg/restore/split.go#L198-L202

Added lines #L198 - L202 were not covered by tests
}
// Heartbeat may not be sent to PD
Expand Down Expand Up @@ -270,7 +275,7 @@ func (rs *RegionSplitter) WaitForScatterRegions(ctx context.Context, regionInfos
ok, rescatter, err := rs.isScatterRegionFinished(ctx1, regionID)
if err != nil {
log.Warn("scatter region failed: do not have the region",
logutil.Region(regionInfo.Region))
logutil.Region(regionInfo.Region), zap.Error(err))
delete(leftRegions, regionID)
continue

Check warning on line 280 in br/pkg/restore/split.go

View check run for this annotation

Codecov / codecov/patch

br/pkg/restore/split.go#L277-L280

Added lines #L277 - L280 were not covered by tests
}
Expand Down

0 comments on commit 348ad44

Please sign in to comment.