Skip to content

Commit

Permalink
backupccl: bump version on restore mixed version test
Browse files Browse the repository at this point in the history
This change bumps the mixed version restore test
to use the current minimum binary version instead of
an older V22_2Start gate that will soon be deleted.

Informs: cockroachdb#100552
Release note: None
  • Loading branch information
adityamaru committed Apr 5, 2023
1 parent 035887c commit b2262e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
19 changes: 8 additions & 11 deletions pkg/ccl/backupccl/datadriven_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ var localityCfgs = map[string]roachpb.Locality{
}

var clusterVersionKeys = map[string]clusterversion.Key{
"23_1_Start": clusterversion.V23_1Start,
"23_1_MVCCTombstones": clusterversion.V23_1_MVCCRangeTombstonesUnconditionallyEnabled,
}

Expand Down Expand Up @@ -156,21 +157,18 @@ func (d *datadrivenTestState) addCluster(t *testing.T, cfg clusterCfg) error {
}

settings := cluster.MakeTestingClusterSettings()

if cfg.beforeVersion != "" {
settings = cluster.MakeClusterSettings()
beforeKey, ok := clusterVersionKeys[cfg.beforeVersion]
if !ok {
t.Fatalf("clusterVersion %s does not exist in data driven global map", cfg.beforeVersion)
}
beforeKey--
params.ServerArgs.Knobs.Server = &server.TestingKnobs{
BinaryVersionOverride: clusterversion.ByKey(beforeKey),
DisableAutomaticVersionUpgrade: make(chan struct{})}
settings = cluster.MakeTestingClusterSettingsWithVersions(
clusterversion.TestingBinaryVersion,
clusterversion.ByKey(beforeKey),
false,
)
DisableAutomaticVersionUpgrade: make(chan struct{}),
BootstrapVersionKeyOverride: clusterversion.BinaryMinSupportedVersionKey,
}
}

closedts.TargetDuration.Override(context.Background(), &settings.SV, 10*time.Millisecond)
Expand Down Expand Up @@ -277,10 +275,9 @@ func (d *datadrivenTestState) getSQLDB(t *testing.T, name string, user string) *
//
// - splits: specifies the number of ranges the bank table is split into.
//
// - before-version=<beforeVersion>: creates a mixed version cluster where all
// nodes running the test cluster binary think the clusterVersion is one
// version before the passed in <beforeVersion> key. See cockroach_versions.go
// for possible values.
// - before-version=<beforeVersion>: bootstraps the test cluster and upgrades
// it to a cluster version that is one version before the passed in
// <beforeVersion> key. See cockroach_versions.go for possible values.
//
// - testingKnobCfg: specifies a key to a hardcoded testingKnob configuration
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
new-cluster name=s1 beforeVersion=Start22_2 disable-tenant
new-cluster name=s1 beforeVersion=23_1_Start disable-tenant
----

exec-sql
Expand All @@ -15,7 +15,7 @@ BACKUP INTO 'nodelocal://1/full_cluster_backup/';
# This is a cluster where the cluster version is behind the binary version. Such
# a condition only occurs when the user has upgraded the node to a new major
# version but has not yet finalized the upgrade.
new-cluster name=s2 beforeVersion=Start22_2 share-io-dir=s1 disable-tenant
new-cluster name=s2 beforeVersion=23_1_Start share-io-dir=s1 disable-tenant
----

exec-sql expect-error-regex=(pq: cluster restore not supported during major version upgrade: restore started at cluster version .* but binary version is.*)
Expand Down

0 comments on commit b2262e5

Please sign in to comment.