Skip to content

Commit 4eb8e22

Browse files
craig[bot]herkolategan
andcommitted
Merge #147377
147377: roachtest: use from version for workload r=stevendanna a=herkolategan Previously, `rebalance/by-load/leases/mixed-version` used the master workload binary. This caused compatibility issue with mixed version tests. This change uploads the `from version` workload binary to the cluster, before running the workload. Fixes: #147250 Informs: #147374 Epic: None Release note: None Co-authored-by: Herko Lategan <[email protected]>
2 parents e42de35 + fdb6651 commit 4eb8e22

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

pkg/cmd/roachtest/tests/rebalance_load.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,19 @@ func registerRebalanceLoad(r registry.Registry) {
112112
})
113113
mvt.InMixedVersion("rebalance load run",
114114
func(ctx context.Context, l *logger.Logger, r *rand.Rand, h *mixedversion.Helper) error {
115+
binary := uploadCockroach(ctx, t, c, appNode, h.System.FromVersion)
115116
return rebalanceByLoad(
116-
ctx, t, l, c, rebalanceMode, maxDuration, concurrency, appNode, numStores, numNodes)
117+
ctx, t, l, c, maxDuration, concurrency, appNode,
118+
fmt.Sprintf("%s workload", binary), numStores, numNodes)
117119
})
118120
mvt.Run()
119121
} else {
120122
// Note that CPU profiling is already enabled by default, should there be
121123
// a failure it will be available in the artifacts.
122124
c.Start(ctx, t.L(), startOpts, settings, roachNodes)
123125
require.NoError(t, rebalanceByLoad(
124-
ctx, t, t.L(), c, rebalanceMode, maxDuration,
125-
concurrency, appNode, numStores, numNodes,
126+
ctx, t, t.L(), c, maxDuration,
127+
concurrency, appNode, "./cockroach workload", numStores, numNodes,
126128
))
127129
}
128130

@@ -236,19 +238,20 @@ func rebalanceByLoad(
236238
t test.Test,
237239
l *logger.Logger,
238240
c cluster.Cluster,
239-
rebalanceMode string,
240241
maxDuration time.Duration,
241242
concurrency int,
242243
appNode option.NodeListOption,
244+
workloadPath string,
243245
numStores, numNodes int,
244246
) error {
247+
245248
// We want each store to end up with approximately storeToRangeFactor
246249
// (factor) leases such that the CPU load is evenly spread, e.g.
247250
// (n * factor) -1 splits = factor * n ranges = factor leases per store
248251
// Note that we only assert on the CPU of each store w.r.t the mean, not
249252
// the lease count.
250253
splits := (numStores * storeToRangeFactor) - 1
251-
c.Run(ctx, option.WithNodes(appNode), fmt.Sprintf("./cockroach workload init kv --drop --splits=%d {pgurl:1}", splits))
254+
c.Run(ctx, option.WithNodes(appNode), fmt.Sprintf("%s init kv --drop --splits=%d {pgurl:1}", workloadPath, splits))
252255

253256
db := c.Conn(ctx, l, 1)
254257
defer db.Close()
@@ -264,9 +267,9 @@ func rebalanceByLoad(
264267
m.Go(func(ctx context.Context, l *logger.Logger) error {
265268
l.Printf("starting load generator")
266269
err := c.RunE(ctx, option.WithNodes(appNode), fmt.Sprintf(
267-
"./cockroach workload run kv --read-percent=95 --tolerate-errors --concurrency=%d "+
270+
"%s run kv --read-percent=95 --tolerate-errors --concurrency=%d "+
268271
"--duration=%v {pgurl:1-%d}",
269-
concurrency, maxDuration, numNodes))
272+
workloadPath, concurrency, maxDuration, numNodes))
270273
if errors.Is(ctx.Err(), context.Canceled) {
271274
// We got canceled either because CPU balance was achieved or the
272275
// other worker hit an error. In either case, it's not this worker's

0 commit comments

Comments
 (0)