Skip to content

Commit a198a44

Browse files
committed
roachtest: start workload after initial scan
Previously, the ldr create test started the TPCC workload before the destination completed the initial scan. This caused the workload to build up backlog. TPCC is an update heavy workload that does not modify indexed columns. As a result, the KV writer is more efficient at replicating it than the SQL writer. The test was failing because the SQL writer took too long to catch up on the backlog. Now, the initial table creation is allowed to complete before the SQL writer is started. The latency bounds were tightened since it no longer needs to catch up. Release note none Part of: #144224 Part of: #143958
1 parent 6ac9542 commit a198a44

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/cmd/roachtest/tests/logical_data_replication.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,11 @@ func TestLDRCreateTablesTPCC(
426426
option.WithNodes(setup.workloadNode),
427427
fmt.Sprintf("./cockroach workload init tpcc --warehouses=%d --fks=false {pgurl:%d:system}", warehouses, setup.left.nodes[0]))
428428

429+
// Setup LDR before the workload starts. Otherwise the workload generates a
430+
// backlog as the initial scan runs and it can take away while for the sql
431+
// writer to catch up with the UPDATE heavy TPCC workload.
432+
_, rightJobID := setupLDR(ctx, t, c, setup, workload, ldrConfig)
433+
429434
workloadDoneCh := make(chan struct{})
430435
monitor := c.NewMonitor(ctx, setup.CRDBNodes())
431436
monitor.Go(func(ctx context.Context) error {
@@ -435,9 +440,8 @@ func TestLDRCreateTablesTPCC(
435440
// on data ingested via the offline initial scan.
436441
return c.RunE(ctx, option.WithNodes(setup.workloadNode), workload.workload.sourceRunCmd("system", setup.left.nodes))
437442
})
438-
_, rightJobID := setupLDR(ctx, t, c, setup, workload, ldrConfig)
439443

440-
maxExpectedLatency := 3 * time.Minute
444+
maxExpectedLatency := time.Minute + 30*time.Second
441445
validateLatency := setupLatencyVerifiers(ctx, t, c, monitor, 0 /* leftJobID */, rightJobID, setup, workloadDoneCh, maxExpectedLatency)
442446

443447
monitor.Wait()

0 commit comments

Comments
 (0)