Skip to content

Commit

Permalink
roachtest: enable schema changes in acceptance/version-upgrade
Browse files Browse the repository at this point in the history
Previously, due to flakes we disabled schema changes inside
the version update test. This patch re-enables them, since
we are confident that the workload itslef is now stable in a
mixed version state.

Fixes: cockroachdb#58489
Release note: None
  • Loading branch information
fqazi committed Mar 17, 2023
1 parent 87c0fd5 commit 2f65e5d
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion pkg/cmd/roachtest/tests/versionupgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"context"
gosql "database/sql"
"fmt"
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil"
"math/rand"
"path/filepath"
"runtime"
Expand Down Expand Up @@ -102,8 +103,15 @@ func runVersionUpgrade(ctx context.Context, t test.Test, c cluster.Cluster) {
if c.IsLocal() && runtime.GOARCH == "arm64" {
t.Skip("Skip under ARM64. See https://github.com/cockroachdb/cockroach/issues/89268")
}

mvt := mixedversion.NewTest(ctx, t, t.L(), c, c.All())
mvt.OnStartup("setup schema changer workload", func(ctx context.Context, l *logger.Logger, r *rand.Rand, helper *mixedversion.Helper) error {
// Stage workload on all nodes as the load node to run workload is chosen
// randomly.
if err := c.PutE(ctx, t.L(), t.DeprecatedWorkload(), "./workload", c.All()); err != nil {
return err
}
return c.RunE(ctx, c.All(), "./workload init", "schemachange")
})
mvt.InMixedVersion("run backup", func(ctx context.Context, l *logger.Logger, rng *rand.Rand, h *mixedversion.Helper) error {
// Verify that backups can be created in various configurations. This is
// important to test because changes in system tables might cause backups to
Expand All @@ -126,6 +134,19 @@ func runVersionUpgrade(ctx context.Context, t test.Test, c cluster.Cluster) {
return nil
},
)
mvt.InMixedVersion(
"test schema change step",
func(ctx context.Context, l *logger.Logger, rng *rand.Rand, h *mixedversion.Helper) error {
l.Printf("running schema workload step")
runCmd := roachtestutil.NewCommand("./workload run schemachange")
runCmd.Flag("verbose", 1)
runCmd.Flag("max-ops", 10)
runCmd.Flag("concurrency", 2)
runCmd.Arg("{pgurl:1-%d}", len(c.All()))
randomNode := c.All().RandNode()
return c.RunE(ctx, randomNode, runCmd.String())
},
)
mvt.AfterUpgradeFinalized(
"check if GC TTL is pinned",
func(ctx context.Context, l *logger.Logger, rng *rand.Rand, h *mixedversion.Helper) error {
Expand Down

0 comments on commit 2f65e5d

Please sign in to comment.