From 5c4567451c3198aa41597e1ce14c2bada33a46d1 Mon Sep 17 00:00:00 2001 From: Andrei Matei Date: Thu, 19 Sep 2019 14:05:28 -0400 Subject: [PATCH] roachtest: handle tables added in 19.2 Fixes #40662 Release justification: Test only. Release note: None --- pkg/cmd/roachtest/gossip.go | 9 +++++++-- pkg/cmd/roachtest/test.go | 2 -- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/roachtest/gossip.go b/pkg/cmd/roachtest/gossip.go index 1a2445327da8..42b56db9a46a 100644 --- a/pkg/cmd/roachtest/gossip.go +++ b/pkg/cmd/roachtest/gossip.go @@ -350,9 +350,14 @@ func runGossipRestartNodeOne(ctx context.Context, t *test, c *cluster) { run(`ALTER DATABASE system %[1]s CONFIGURE ZONE %[2]s 'constraints: {"-rack=0"}'`) run(`ALTER RANGE meta %[1]s CONFIGURE ZONE %[2]s 'constraints: {"-rack=0"}'`) run(`ALTER RANGE liveness %[1]s CONFIGURE ZONE %[2]s 'constraints: {"-rack=0"}'`) + // TODO(andrei): Changing the constraints for the system tables shouldn't be + // needed given that we've changed them for the system zone. What's going on? + // #40921. run(`ALTER TABLE system.jobs %[1]s CONFIGURE ZONE %[2]s 'constraints: {"-rack=0"}'`) - run(`ALTER TABLE system.replication_stats %[1]s CONFIGURE ZONE %[2]s 'constraints: {"-rack=0"}'`) - run(`ALTER TABLE system.replication_constraint_stats %[1]s CONFIGURE ZONE %[2]s 'constraints: {"-rack=0"}'`) + if t.IsBuildVersion("v19.2.0") { + run(`ALTER TABLE system.replication_stats %[1]s CONFIGURE ZONE %[2]s 'constraints: {"-rack=0"}'`) + run(`ALTER TABLE system.replication_constraint_stats %[1]s CONFIGURE ZONE %[2]s 'constraints: {"-rack=0"}'`) + } var lastReplCount int if err := retry.ForDuration(2*time.Minute, func() error { diff --git a/pkg/cmd/roachtest/test.go b/pkg/cmd/roachtest/test.go index b309987fa50f..f18c92c953e1 100644 --- a/pkg/cmd/roachtest/test.go +++ b/pkg/cmd/roachtest/test.go @@ -400,8 +400,6 @@ func (t *test) IsBuildVersion(minVersion string) bool { return t.buildVersion.AtLeast(vers) } -var _ = (*test)(nil).IsBuildVersion // avoid unused lint - // teamCityEscape escapes a string for use as in a key='' attribute // in TeamCity build output marker. // Documentation here: https://confluence.jetbrains.com/display/TCD10/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-Escapedvalues