Skip to content

Commit

Permalink
This is an automated cherry-pick of #7746
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
overvenus authored and ti-chi-bot committed Nov 30, 2022
1 parent ed9ffce commit 1da0224
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/version/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
27 changes: 27 additions & 0 deletions pkg/version/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 1da0224

Please sign in to comment.