From 476f44a08054cc5bc3be5eadc7e512621b58115f Mon Sep 17 00:00:00 2001 From: adityamaru Date: Wed, 5 Apr 2023 09:36:45 -0400 Subject: [PATCH] backupccl: bump version on restore mixed version test 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: #100552 Release note: None --- pkg/ccl/backupccl/datadriven_test.go | 20 ++++++++----------- .../backup-restore/restore-mixed-version | 4 ++-- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/pkg/ccl/backupccl/datadriven_test.go b/pkg/ccl/backupccl/datadriven_test.go index 279ecc00da75..24ab9e333b85 100644 --- a/pkg/ccl/backupccl/datadriven_test.go +++ b/pkg/ccl/backupccl/datadriven_test.go @@ -80,7 +80,7 @@ var localityCfgs = map[string]roachpb.Locality{ } var clusterVersionKeys = map[string]clusterversion.Key{ - "Start22_2": clusterversion.TODODelete_V22_2Start, + "23_1_Start": clusterversion.V23_1Start, "23_1_MVCCTombstones": clusterversion.V23_1_MVCCRangeTombstonesUnconditionallyEnabled, } @@ -156,8 +156,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 +165,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 +274,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.*)