diff --git a/pkg/ccl/backupccl/datadriven_test.go b/pkg/ccl/backupccl/datadriven_test.go index d45e7fc8c3e8..6dda8df87e51 100644 --- a/pkg/ccl/backupccl/datadriven_test.go +++ b/pkg/ccl/backupccl/datadriven_test.go @@ -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, } @@ -156,8 +157,8 @@ 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) @@ -165,12 +166,9 @@ func (d *datadrivenTestState) addCluster(t *testing.T, cfg clusterCfg) error { 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) @@ -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=: creates a mixed version cluster where all -// nodes running the test cluster binary think the clusterVersion is one -// version before the passed in key. See cockroach_versions.go -// for possible values. +// - before-version=: bootstraps the test cluster and upgrades +// it to a cluster version that is one version before the passed in +// key. See cockroach_versions.go for possible values. // // - testingKnobCfg: specifies a key to a hardcoded testingKnob configuration // diff --git a/pkg/ccl/backupccl/testdata/backup-restore/restore-mixed-version b/pkg/ccl/backupccl/testdata/backup-restore/restore-mixed-version index 396d2d60b58b..6f4a5f77da01 100644 --- a/pkg/ccl/backupccl/testdata/backup-restore/restore-mixed-version +++ b/pkg/ccl/backupccl/testdata/backup-restore/restore-mixed-version @@ -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 @@ -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.*)