Skip to content

Commit 63e99cb

Browse files
committed
roachtest: fix missing binary for TPC-C in multitenant upgrade test
Summary: In multitenant upgrade tests, the TPC-C workload may fail if the required binary is missing on a node. This issue can occur when no tenant is created on nodes with the previous binary version, and the workload attempts to run using that binary. A sample excerpt from the upgrade plan illustrates the process: ``` ├── start cluster at version "v23.2.20" (1) ├── wait for all nodes (:1-4) to acknowledge cluster version '23.2' on system tenant (2) ├── set cluster setting "storage.ingest_split.enabled" to 'false' on system tenant (3) ├── run "maybe create some tenants" (4) ├── upgrade cluster from "v23.2.20" to "v24.1.13" │ ├── prevent auto-upgrades on system tenant by setting `preserve_downgrade_option` (5) │ ├── upgrade nodes :1-4 from "v23.2.20" to "v24.1.13" │ │ ├── restart node 2 with binary version v24.1.13 (6) │ │ ├── restart node 1 with binary version v24.1.13 (7) │ │ ├── allow upgrade to happen on system tenant by resetting `preserve_downgrade_option` (8) │ │ ├── restart node 3 with binary version v24.1.13 (9) │ │ ├── restart node 4 with binary version v24.1.13 (10) │ │ └── run "run workload on tenants" (11) │ ├── run "run workload on tenants" (12) ``` Once all the nodes are upgraded (step 10), we enter the finalizing phase in step 11. Our cluster configuration would then look like this, ``` [mixed-version-test/11_run-run-workload-on-tenants] 2025/03/13 10:47:21 runner.go:423: current cluster configuration: n1 n2 n3 n4 released versions v24.1.13 v24.1.13 v24.1.13 v24.1.13 binary versions 24.1 24.1 24.1 24.1 cluster versions 24.1 24.1 24.1 24.1 ``` This implies that our tenant would also start with the target version as we finalize (see #138233). Then we run the TPC-C workload on tenant nodes using the version we are migrating from—likely for compatibility reasons. However, the required binary may be absent if, during step 4, we did not create any tenants with the previous version due to probabilistic selection. The fix is simple: upload the binary used to run TPC-C. The process first checks whether the binary is already present, so no extra performance overhead occurs if it is. Fixes: #140507 Informs: #142807 Release note: None Epic: None
1 parent 85ce336 commit 63e99cb

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

pkg/cmd/roachtest/tests/multitenant_upgrade.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,19 +178,26 @@ func runMultitenantUpgrade(ctx context.Context, t test.Test, c cluster.Cluster)
178178
// parallel. The returned channel is closed once the workload
179179
// finishes running on every tenant.
180180
runTPCC := func(
181-
ctx context.Context, c cluster.Cluster, binaryPath string, h *mixedversion.Helper,
181+
ctx context.Context, h *mixedversion.Helper, version *clusterupgrade.Version,
182182
) chan struct{} {
183183
return forEachTenant(
184184
"run tpcc",
185185
ctx,
186186
h,
187187
func(ctx context.Context, l *logger.Logger, tenant *tenantUpgradeStatus) error {
188+
nodes := c.Node(tenant.nodes[0])
189+
// We may attempt to runTPCC using a cockroach binary version
190+
// that was never uploaded. See #142807.
191+
binaryPath, err := clusterupgrade.UploadCockroach(ctx, t, l, c, nodes, version)
192+
if err != nil {
193+
return errors.Wrapf(err, "uploading cockroach %s", version)
194+
}
188195
cmd := fmt.Sprintf(
189196
"%s workload run tpcc --warehouses %d --duration %s %s",
190197
binaryPath, numWarehouses, tpccDuration, tenant.pgurl(),
191198
)
192199

193-
return c.RunE(ctx, option.WithNodes(c.Node(tenant.nodes[0])), cmd)
200+
return c.RunE(ctx, option.WithNodes(nodes), cmd)
194201
},
195202
)
196203
}
@@ -240,9 +247,8 @@ func runMultitenantUpgrade(ctx context.Context, t test.Test, c cluster.Cluster)
240247
}
241248
}
242249

243-
binaryPath := clusterupgrade.BinaryPathForVersion(t, h.Context().FromVersion, "cockroach")
244250
l.Printf("waiting for tpcc to run on tenants...")
245-
<-runTPCC(ctx, c, binaryPath, h)
251+
<-runTPCC(ctx, h, h.Context().FromVersion)
246252
return nil
247253
},
248254
)
@@ -263,8 +269,7 @@ func runMultitenantUpgrade(ctx context.Context, t test.Test, c cluster.Cluster)
263269
}
264270
}
265271

266-
binaryPath := clusterupgrade.BinaryPathForVersion(t, h.Context().ToVersion, "cockroach")
267-
tpccFinished := runTPCC(ctx, c, binaryPath, h)
272+
tpccFinished := runTPCC(ctx, h, h.Context().ToVersion)
268273

269274
upgradeFinished := forEachTenant(
270275
"finalize upgrade",

0 commit comments

Comments
 (0)