Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-23.1: upgrades,backupccl: audit mixed version and upgrade tests #100832

Merged
merged 3 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions pkg/ccl/backupccl/datadriven_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down Expand Up @@ -156,21 +156,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 +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=<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
11 changes: 2 additions & 9 deletions pkg/upgrade/upgrades/system_job_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/cockroachdb/cockroach/pkg/clusterversion"
"github.com/cockroachdb/cockroach/pkg/keys"
"github.com/cockroachdb/cockroach/pkg/server"
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/desctestutils"
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
Expand All @@ -32,19 +31,13 @@ func TestSystemJobInfoMigration(t *testing.T) {
defer leaktest.AfterTest(t)()
ctx := context.Background()

settings := cluster.MakeTestingClusterSettingsWithVersions(
clusterversion.TestingBinaryVersion,
clusterversion.ByKey(clusterversion.V22_2),
false,
)

tc := testcluster.StartTestCluster(t, 1, base.TestClusterArgs{
ServerArgs: base.TestServerArgs{
Settings: settings,
Knobs: base.TestingKnobs{
Server: &server.TestingKnobs{
DisableAutomaticVersionUpgrade: make(chan struct{}),
BinaryVersionOverride: clusterversion.ByKey(clusterversion.V22_2),
BinaryVersionOverride: clusterversion.ByKey(clusterversion.BinaryMinSupportedVersionKey),
BootstrapVersionKeyOverride: clusterversion.BinaryMinSupportedVersionKey,
},
},
},
Expand Down