Skip to content

Commit bf5d8cb

Browse files
authored
Merge pull request #143184 from cockroachdb/blathers/backport-release-25.1-143055
release-25.1: roachtest: fix missing binary for TPC-C in multitenant upgrade test
2 parents c81c3ae + 48b9205 commit bf5d8cb

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

pkg/cmd/roachtest/tests/multitenant_upgrade.go

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

192-
return c.RunE(ctx, option.WithNodes(c.Node(tenant.nodes[0])), cmd)
199+
return c.RunE(ctx, option.WithNodes(nodes), cmd)
193200
},
194201
)
195202
}
@@ -239,9 +246,8 @@ func runMultitenantUpgrade(ctx context.Context, t test.Test, c cluster.Cluster)
239246
}
240247
}
241248

242-
binaryPath := clusterupgrade.BinaryPathForVersion(t, h.Context().FromVersion, "cockroach")
243249
l.Printf("waiting for tpcc to run on tenants...")
244-
<-runTPCC(ctx, c, binaryPath, h)
250+
<-runTPCC(ctx, h, h.Context().FromVersion)
245251
return nil
246252
},
247253
)
@@ -262,8 +268,7 @@ func runMultitenantUpgrade(ctx context.Context, t test.Test, c cluster.Cluster)
262268
}
263269
}
264270

265-
binaryPath := clusterupgrade.BinaryPathForVersion(t, h.Context().ToVersion, "cockroach")
266-
tpccFinished := runTPCC(ctx, c, binaryPath, h)
271+
tpccFinished := runTPCC(ctx, h, h.Context().ToVersion)
267272

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

0 commit comments

Comments
 (0)