Skip to content

Commit

Permalink
refactor(restore): change scylla version 5.5 checking to 6.0
Browse files Browse the repository at this point in the history
There was never 5.5 release, but for some time the latest docker image had this version and that's why it was used. Now it can be changed to the correct, already released 6.0 version in order to avoid confusions in the future.
  • Loading branch information
Michal-Leszczynski authored and karol-kokoszka committed Jun 20, 2024
1 parent f6555c3 commit c25e05a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pkg/scyllaclient/client_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (ni *NodeInfo) SupportsRepairSmallTableOptimization() (bool, error) {
return true, nil
}
// Check OSS
supports, err := scyllaversion.CheckConstraint(ni.ScyllaVersion, ">= 5.5, < 2000")
supports, err := scyllaversion.CheckConstraint(ni.ScyllaVersion, ">= 6.0, < 2000")
if err != nil {
return false, errors.Errorf("Unsupported Scylla version: %s", ni.ScyllaVersion)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/scyllaclient/client_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func TestNodeInfoSupportsRepairSmallTableOptimization(t *testing.T) {
},
{
scyllaVer: "5.5.0",
expected: true,
expected: false,
},
{
scyllaVer: "6.0.0",
Expand Down
6 changes: 3 additions & 3 deletions pkg/service/restore/restore_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
func TestRestoreTablesUserIntegration(t *testing.T) {
h := newTestHelper(t, ManagedSecondClusterHosts(), ManagedClusterHosts())

if checkAnyConstraint(t, h.dstCluster.Client, ">= 5.5, < 2000", ">= 2024.2, > 1000") {
if checkAnyConstraint(t, h.dstCluster.Client, ">= 6.0, < 2000", ">= 2024.2, > 1000") {
t.Skip("Auth restore is not supported in Scylla 6.0. It requires core side support that is aimed at 6.1 release")
}

Expand Down Expand Up @@ -101,7 +101,7 @@ func TestRestoreSchemaRoundtripIntegration(t *testing.T) {
h := newTestHelper(t, ManagedSecondClusterHosts(), ManagedClusterHosts())
hRev := newTestHelper(t, ManagedClusterHosts(), ManagedSecondClusterHosts())

if !checkAnyConstraint(t, h.dstCluster.Client, ">= 5.5, < 2000", ">= 2024.2, > 1000") {
if !checkAnyConstraint(t, h.dstCluster.Client, ">= 6.0, < 2000", ">= 2024.2, > 1000") {
t.Skip("This test assumes that schema is backed up and restored via DESCRIBE SCHEMA WITH INTERNALS")
}

Expand Down Expand Up @@ -203,7 +203,7 @@ func TestRestoreSchemaRoundtripIntegration(t *testing.T) {
func TestRestoreSchemaDropAddColumnIntegration(t *testing.T) {
h := newTestHelper(t, ManagedSecondClusterHosts(), ManagedClusterHosts())

if !checkAnyConstraint(t, h.dstCluster.Client, ">= 5.5, < 2000", ">= 2024.2, > 1000") {
if !checkAnyConstraint(t, h.dstCluster.Client, ">= 6.0, < 2000", ">= 2024.2, > 1000") {
t.Skip("This test is the reason why SM needs to restore schema by DESCRIBE SCHEMA WITH INTERNALS")
}

Expand Down
12 changes: 6 additions & 6 deletions pkg/service/restore/service_restore_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func TestRestoreGetTargetUnitsViewsIntegration(t *testing.T) {
}

var ignoreTarget []string
if checkAnyConstraint(t, h.Client, ">= 5.5, < 2000", ">= 2024.2, > 1000") {
if checkAnyConstraint(t, h.Client, ">= 6.0, < 2000", ">= 2024.2, > 1000") {
ignoreTarget = []string{
"!system_auth.*",
"!system_distributed.service_levels",
Expand All @@ -325,7 +325,7 @@ func TestRestoreGetTargetUnitsViewsIntegration(t *testing.T) {
if checkAnyConstraint(t, h.Client, "< 2024.2") {
ignoreUnits = append(ignoreUnits, "dicts")
}
if checkAnyConstraint(t, h.Client, ">= 5.5, < 2000", ">= 2024.2, > 1000") {
if checkAnyConstraint(t, h.Client, ">= 6.0, < 2000", ">= 2024.2, > 1000") {
ignoreUnits = append(ignoreUnits,
"system_auth",
"service_levels",
Expand Down Expand Up @@ -1338,7 +1338,7 @@ func restoreAllTables(t *testing.T, schemaTarget, tablesTarget Target, keyspace
{ks: "system_traces", tab: "sessions"},
{ks: "system_traces", tab: "sessions_time_idx"},
}
if !checkAnyConstraint(t, dstH.Client, ">= 5.5, < 2000", ">= 2024.2, > 1000") {
if !checkAnyConstraint(t, dstH.Client, ">= 6.0, < 2000", ">= 2024.2, > 1000") {
toValidate = append(toValidate,
table{ks: "system_auth", tab: "role_attributes"},
table{ks: "system_auth", tab: "role_members"},
Expand Down Expand Up @@ -1411,7 +1411,7 @@ func restoreAlternator(t *testing.T, schemaTarget, tablesTarget Target, testKeys
)

dstH.shouldSkipTest(schemaTarget, tablesTarget)
if checkAnyConstraint(t, dstH.Client, ">= 5.5, < 2000", ">= 2024.2, > 1000") {
if checkAnyConstraint(t, dstH.Client, ">= 6.0, < 2000", ">= 2024.2, > 1000") {
t.Skip("See https://github.com/scylladb/scylladb/issues/19112")
}

Expand Down Expand Up @@ -1479,7 +1479,7 @@ func (h *restoreTestHelper) validateRestoreSuccess(dstSession, srcSession gocqlx
}

if target.RestoreSchema {
if !checkAnyConstraint(h.T, h.Client, ">= 5.5, < 2000", ">= 2024.2, > 1000") {
if !checkAnyConstraint(h.T, h.Client, ">= 6.0, < 2000", ">= 2024.2, > 1000") {
// Schema restart is required only for older Scylla versions
h.restartScylla()
}
Expand Down Expand Up @@ -1747,7 +1747,7 @@ func getBucketKeyspaceUser(t *testing.T) (string, string, string) {
func (h *restoreTestHelper) shouldSkipTest(targets ...Target) {
for _, target := range targets {
if target.RestoreSchema {
if err := IsRestoreSchemaFromSSTablesSupported(context.Background(), h.Client); err != nil && !checkAnyConstraint(h.T, h.Client, ">= 5.5, < 2000", ">= 2024.2, > 1000") {
if err := IsRestoreSchemaFromSSTablesSupported(context.Background(), h.Client); err != nil && !checkAnyConstraint(h.T, h.Client, ">= 6.0, < 2000", ">= 2024.2, > 1000") {
h.T.Skip(err)
}
}
Expand Down

0 comments on commit c25e05a

Please sign in to comment.