Skip to content

Commit

Permalink
distiguish error return by checkStoreVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
lidezhu authored and ti-chi-bot committed Dec 24, 2024
1 parent 472ef3b commit e434beb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cdc/kv/shared_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/pingcap/log"
"github.com/pingcap/tiflow/cdc/kv/sharedconn"
"github.com/pingcap/tiflow/pkg/chann"
cerrors "github.com/pingcap/tiflow/pkg/errors"
"github.com/pingcap/tiflow/pkg/util"
"github.com/pingcap/tiflow/pkg/version"
"go.uber.org/zap"
Expand Down Expand Up @@ -101,8 +102,11 @@ func newStream(ctx context.Context, c *SharedClient, g *errgroup.Group, r *reque
zap.Error(err))
if errors.Cause(err) == context.Canceled {
return nil

Check warning on line 104 in cdc/kv/shared_stream.go

View check run for this annotation

Codecov / codecov/patch

cdc/kv/shared_stream.go#L104

Added line #L104 was not covered by tests
} else if cerrors.Is(err, cerrors.ErrGetAllStoresFailed) {
regionErr = &getStoreErr{}
} else {
regionErr = &sendRequestToStoreErr{}
}

Check warning on line 109 in cdc/kv/shared_stream.go

View check run for this annotation

Codecov / codecov/patch

cdc/kv/shared_stream.go#L108-L109

Added lines #L108 - L109 were not covered by tests
regionErr = &getStoreErr{}
} else {
if canceled := stream.run(ctx, c, r); canceled {
return nil
Expand Down

0 comments on commit e434beb

Please sign in to comment.