From a8694c492876f859be82a72822597b75d64b6697 Mon Sep 17 00:00:00 2001 From: dongmen <20351731+asddongmen@users.noreply.github.com> Date: Mon, 30 Jan 2023 21:45:54 +0800 Subject: [PATCH] ticdc: workround for get source id error (#8136) ref pingcap/tiflow#8110, ref pingcap/tiflow#8115 --- pkg/pdutil/utils.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/pdutil/utils.go b/pkg/pdutil/utils.go index 412707d5b79..3f52db72823 100644 --- a/pkg/pdutil/utils.go +++ b/pkg/pdutil/utils.go @@ -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" @@ -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