From 1da0224a4039a20d88738871a367a7e2ac1c76e7 Mon Sep 17 00:00:00 2001 From: Neil Shen Date: Wed, 30 Nov 2022 21:02:00 +0800 Subject: [PATCH] This is an automated cherry-pick of #7746 Signed-off-by: ti-chi-bot --- pkg/version/check.go | 5 +++++ pkg/version/check_test.go | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/pkg/version/check.go b/pkg/version/check.go index dbefe63bf27..baf0e2bff04 100644 --- a/pkg/version/check.go +++ b/pkg/version/check.go @@ -25,6 +25,7 @@ import ( "github.com/coreos/go-semver/semver" "github.com/pingcap/kvproto/pkg/metapb" "github.com/pingcap/log" + "github.com/pingcap/tidb/util/engine" cerror "github.com/pingcap/tiflow/pkg/errors" "github.com/pingcap/tiflow/pkg/httputil" "github.com/pingcap/tiflow/pkg/security" @@ -166,6 +167,10 @@ func CheckStoreVersion(ctx context.Context, client pd.Client, storeID uint64) er } for _, s := range stores { + if engine.IsTiFlash(s) { + continue + } + ver, err := semver.NewVersion(removeVAndHash(s.Version)) if err != nil { return cerror.WrapError(cerror.ErrNewSemVersion, err) diff --git a/pkg/version/check_test.go b/pkg/version/check_test.go index 47dac43a360..d5bb583a425 100644 --- a/pkg/version/check_test.go +++ b/pkg/version/check_test.go @@ -23,6 +23,11 @@ import ( "github.com/coreos/go-semver/semver" "github.com/pingcap/kvproto/pkg/metapb" +<<<<<<< HEAD +======= + "github.com/pingcap/tidb/util/engine" + "github.com/pingcap/tiflow/pkg/httputil" +>>>>>>> e7e2894c18 (version(ticdc): skip checking TiFlash version (#7746)) "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" pd "github.com/tikv/pd/client" @@ -129,7 +134,29 @@ func TestCheckClusterVersion(t *testing.T) { require.Nil(t, err) } +<<<<<<< HEAD // Check maximum compatible TiKV. +======= + // Skip checking TiFlash. + { + mock.getPDVersion = func() string { + return minPDVersion.String() + } + + tiflashStore := &metapb.Store{ + Version: maxTiKVVersion.String(), + Labels: []*metapb.StoreLabel{{Key: "engine", Value: "tiflash"}}, + } + require.True(t, engine.IsTiFlash(tiflashStore)) + mock.getAllStores = func() []*metapb.Store { + return []*metapb.Store{tiflashStore} + } + err := CheckClusterVersion(context.Background(), &mock, pdAddrs, nil, true) + require.Nil(t, err) + } + + // Check maximum supported TiKV version +>>>>>>> e7e2894c18 (version(ticdc): skip checking TiFlash version (#7746)) { mock.getVersion = func() string { return minPDVersion.String()