From a4aa8ef496c66e904407680a7a4b601fc64c256e Mon Sep 17 00:00:00 2001 From: Faizan Qazi Date: Fri, 17 Mar 2023 14:34:50 +0000 Subject: [PATCH] roachtest: enable schema changes in acceptance/version-upgrade 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: #58489 Release note: None --- pkg/cmd/roachtest/tests/versionupgrade.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/roachtest/tests/versionupgrade.go b/pkg/cmd/roachtest/tests/versionupgrade.go index cf87d9c476c3..d4321e007aeb 100644 --- a/pkg/cmd/roachtest/tests/versionupgrade.go +++ b/pkg/cmd/roachtest/tests/versionupgrade.go @@ -21,6 +21,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/cluster" "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/option" + "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil" "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil/clusterupgrade" "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil/mixedversion" "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/test" @@ -102,8 +103,12 @@ 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") } - + c.Put(ctx, t.DeprecatedWorkload(), "./workload", c.All()) 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 { + // Execute the workload init. + 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 @@ -126,6 +131,15 @@ 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").Flag("verbose", 1).Flag("max-ops", 10).Flag("concurrency", 2).Arg("{pgurl:1-%d}", len(c.All())) + randomNode := h.RandomNode(rng, c.All()) + return c.RunE(ctx, option.NodeListOption{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 {