Skip to content

Commit

Permalink
ticdc: workround for get source id error (#8136)
Browse files Browse the repository at this point in the history
ref #8110, ref #8115
  • Loading branch information
asddongmen committed Jan 30, 2023
1 parent 56293d0 commit a8694c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/pdutil/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import (
"context"
"strconv"

"github.com/pingcap/log"
cerror "github.com/pingcap/tiflow/pkg/errors"
pd "github.com/tikv/pd/client"
"go.uber.org/zap"
)

const sourceIDName = "source_id"
Expand All @@ -39,7 +41,9 @@ func GetSourceID(ctx context.Context, pdClient pd.Client) (uint64, error) {
if len(sourceIDConfig) != 0 && sourceIDConfig[0].Value != "" {
sourceID, err = strconv.ParseUint(sourceIDConfig[0].Value, 10, 64)
if err != nil {
return 0, cerror.WrapError(cerror.ErrPDEtcdAPIError, err)
// FIXME: return error here after we fix the compatibility issue
log.Error("parse source id failed, use the default sourceID: 1", zap.Error(err))
// return 0, cerror.WrapError(cerror.ErrPDEtcdAPIError, err)
}
}
return sourceID, nil
Expand Down

0 comments on commit a8694c4

Please sign in to comment.