Skip to content

Commit 3476db4

Browse files
Merge 5bf75ee into blathers/backport-release-25.4-156971
2 parents c9278dc + 5bf75ee commit 3476db4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pkg/cmd/roachtest/tests/sysbench.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,15 @@ func runSysbench(ctx context.Context, t test.Test, c cluster.Cluster, opts sysbe
197197
var start time.Time
198198
runWorkload := func(ctx context.Context) error {
199199
t.Status("preparing workload")
200-
cmd := opts.cmd(useHAProxy /* haproxy */)
201200
{
202-
result, err := c.RunWithDetailsSingleNode(ctx, t.L(), option.WithNodes(c.WorkloadNode()), roachtestutil.PrefixCmdOutputWithTimestamp(cmd+" prepare"))
201+
opts := opts
202+
// We often see the prepare phase hit `result is ambiguous: error=replica unavailable`
203+
// due to io overload. Sysbench prepare parallelizes work based on number of tables,
204+
// so limit concurrency to half the number of tables so we aren't inserting into every
205+
// table at once.
206+
opts.concurrency = opts.tables / 2
207+
208+
result, err := c.RunWithDetailsSingleNode(ctx, t.L(), option.WithNodes(c.WorkloadNode()), roachtestutil.PrefixCmdOutputWithTimestamp(opts.cmd(useHAProxy)+" prepare"))
203209
if err != nil {
204210
return err
205211
} else if msg, crashed := detectSysbenchCrash(result); crashed {
@@ -231,7 +237,7 @@ func runSysbench(ctx context.Context, t test.Test, c cluster.Cluster, opts sysbe
231237

232238
t.Status("running workload")
233239
start = timeutil.Now()
234-
result, err := c.RunWithDetailsSingleNode(ctx, t.L(), option.WithNodes(c.WorkloadNode()), roachtestutil.PrefixCmdOutputWithTimestamp(cmd+" run"))
240+
result, err := c.RunWithDetailsSingleNode(ctx, t.L(), option.WithNodes(c.WorkloadNode()), roachtestutil.PrefixCmdOutputWithTimestamp(opts.cmd(useHAProxy)+" run"))
235241

236242
if msg, crashed := detectSysbenchCrash(result); crashed {
237243
t.Skipf("%s; skipping test", msg)

0 commit comments

Comments
 (0)