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

roachtest: don't run schema change workload on 19.2 releases #49662

Merged
merged 1 commit into from May 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions pkg/cmd/roachtest/acceptance.go
Expand Up @@ -51,11 +51,7 @@ func registerAcceptance(r *testRegistry) {
{
name: "version-upgrade",
fn: func(ctx context.Context, t *test, c *cluster) {
predV, err := PredecessorVersion(r.buildVersion)
if err != nil {
t.Fatal(err)
}
runVersionUpgrade(ctx, t, c, predV)
runVersionUpgrade(ctx, t, c, r.buildVersion)
},
// This test doesn't like running on old versions because it upgrades to
// the latest released version and then it tries to "head", where head is
Expand Down
21 changes: 15 additions & 6 deletions pkg/cmd/roachtest/mixed_version_schemachange.go
Expand Up @@ -13,6 +13,8 @@ package main
import (
"context"
"fmt"

"github.com/cockroachdb/cockroach/pkg/util/version"
)

func registerSchemaChangeMixedVersions(r *testRegistry) {
Expand All @@ -25,15 +27,11 @@ func registerSchemaChangeMixedVersions(r *testRegistry) {
MinVersion: "v20.1.0",
Cluster: makeClusterSpec(4),
Run: func(ctx context.Context, t *test, c *cluster) {
predV, err := PredecessorVersion(r.buildVersion)
if err != nil {
t.Fatal(err)
}
maxOps := 100
if local {
maxOps = 10
}
runSchemaChangeMixedVersions(ctx, t, c, maxOps, predV)
runSchemaChangeMixedVersions(ctx, t, c, maxOps, r.buildVersion)
},
})
}
Expand Down Expand Up @@ -63,12 +61,23 @@ func runSchemaChangeWorkloadStep(maxOps int) versionStep {
}

func runSchemaChangeMixedVersions(
ctx context.Context, t *test, c *cluster, maxOps int, predecessorVersion string,
ctx context.Context, t *test, c *cluster, maxOps int, buildVersion version.Version,
) {
predecessorVersion, err := PredecessorVersion(buildVersion)
if err != nil {
t.Fatal(err)
}

// An empty string will lead to the cockroach binary specified by flag
// `cockroach` to be used.
const mainVersion = ""
schemaChangeStep := runSchemaChangeWorkloadStep(maxOps)
if buildVersion.Major() < 20 {
// Schema change workload is meant to run only on versions 19.2 or higher.
// If the main version is below 20.1 then then predecessor version will be
// below 19.2.
schemaChangeStep = nil
}

u := newVersionUpgradeTest(c,
uploadAndStartFromCheckpointFixture(c.All(), predecessorVersion),
Expand Down
11 changes: 8 additions & 3 deletions pkg/cmd/roachtest/versionupgrade.go
Expand Up @@ -72,7 +72,11 @@ DROP TABLE test.t;
`),
}

func runVersionUpgrade(ctx context.Context, t *test, c *cluster, predecessorVersion string) {
func runVersionUpgrade(ctx context.Context, t *test, c *cluster, buildVersion version.Version) {
predecessorVersion, err := PredecessorVersion(buildVersion)
if err != nil {
t.Fatal(err)
}
// This test uses fixtures and we do not have encrypted fixtures right now.
c.encryptDefault = false

Expand Down Expand Up @@ -159,8 +163,9 @@ func (u *versionUpgradeTest) run(ctx context.Context, t *test) {
}()

for _, step := range u.steps {
step(ctx, t, u)

if step != nil {
step(ctx, t, u)
}
}
}

Expand Down