Skip to content

Commit d59ff4e

Browse files
craig[bot]aerfrei
andcommitted
Merge #146638
146638: roachtest: extend timeout for fine grained checkpointing r=andyyang890 a=aerfrei This test was failing on master with both timeouts and duplicates in excess of the limit. This commit removes the duplicate limit for this test and extends the timeout from 15 minutes to 30 minutes. Epic: none Fixes: #146496 Co-authored-by: Aerin Freilich <[email protected]>
2 parents 798a005 + 17693ed commit d59ff4e

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

pkg/cmd/roachtest/tests/cdc.go

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,23 +1191,23 @@ func runCDCInitialScanRollingRestart(
11911191
}
11921192
}
11931193

1194+
type fineGrainedCheckpointingParams struct {
1195+
numRanges int
1196+
transientErrorFrequency time.Duration
1197+
rangeDelays []time.Duration
1198+
maxVal int
1199+
}
1200+
11941201
// runCDCFineGrainedCheckpointingBenchmark runs a changefeed
11951202
// on a 4-node cluster, using node 1 as the coordinator. It will split the
11961203
// table into many ranges and start a sink which will be artificially slower
11971204
// on some of the ranges so that our fine grained checkpoints are exercised.
11981205
// This sink will also occasionally error which should force restarts and
11991206
// restore from these fine-grained checkpoints.
12001207
func runCDCFineGrainedCheckpointingBenchmark(
1201-
ctx context.Context,
1202-
t test.Test,
1203-
c cluster.Cluster,
1204-
numRanges int,
1205-
transientErrorFrequency time.Duration,
1206-
rangeDelays []time.Duration,
1207-
maxVal int,
1208-
dupeLimit int,
1208+
ctx context.Context, t test.Test, c cluster.Cluster, params fineGrainedCheckpointingParams,
12091209
) {
1210-
if len(rangeDelays) > numRanges {
1210+
if len(params.rangeDelays) > params.numRanges {
12111211
t.Fatalf("too many range delays provided")
12121212
}
12131213

@@ -1287,11 +1287,11 @@ func runCDCFineGrainedCheckpointingBenchmark(
12871287
}
12881288

12891289
values := []string{}
1290-
for i := 0; i < numRanges; i++ {
1290+
for i := 0; i < params.numRanges; i++ {
12911291
values = append(values, fmt.Sprintf("(%d, 0)", i*10))
12921292
}
12931293
setupStmts = append(setupStmts, fmt.Sprintf("INSERT INTO foo VALUES %s", strings.Join(values, ", ")))
1294-
setupStmts = append(setupStmts, fmt.Sprintf("ALTER TABLE foo SPLIT AT SELECT generate_series(0, %d, 10)", numRanges*10))
1294+
setupStmts = append(setupStmts, fmt.Sprintf("ALTER TABLE foo SPLIT AT SELECT generate_series(0, %d, 10)", params.numRanges*10))
12951295

12961296
for _, s := range setupStmts {
12971297
t.L().Printf(s)
@@ -1301,15 +1301,15 @@ func runCDCFineGrainedCheckpointingBenchmark(
13011301
}
13021302

13031303
delayStrings := []string{}
1304-
for _, delay := range rangeDelays {
1304+
for _, delay := range params.rangeDelays {
13051305
delayStrings = append(delayStrings, fmt.Sprint(delay.Milliseconds()))
13061306
}
13071307

13081308
// Run the sink server.
13091309
m.Go(func(ctx context.Context) error {
13101310
t.L().Printf("starting up sink server at %s...", sinkURL)
13111311
err := c.RunE(ctx, option.WithNodes(c.Node(c.Spec().NodeCount)),
1312-
fmt.Sprintf("./cockroach workload debug webhook-server-slow %d %s", transientErrorFrequency.Milliseconds(), strings.Join(delayStrings, " ")))
1312+
fmt.Sprintf("./cockroach workload debug webhook-server-slow %d %s", params.transientErrorFrequency.Milliseconds(), strings.Join(delayStrings, " ")))
13131313
if err != nil {
13141314
return err
13151315
}
@@ -1330,7 +1330,7 @@ func runCDCFineGrainedCheckpointingBenchmark(
13301330
}
13311331

13321332
var inserts []string
1333-
for i := 0; i < numRanges; i++ {
1333+
for i := 0; i < params.numRanges; i++ {
13341334
for j := 1; j < 10; j++ {
13351335
inserts = append(inserts, fmt.Sprintf("(%d, 0)", i*10+j))
13361336
}
@@ -1341,7 +1341,7 @@ func runCDCFineGrainedCheckpointingBenchmark(
13411341
t.Fatal(err)
13421342
}
13431343

1344-
for c := 1; c <= maxVal; c++ {
1344+
for c := 1; c <= params.maxVal; c++ {
13451345
if _, err := db.Exec(fmt.Sprintf(
13461346
"UPDATE foo SET val = %d", c)); err != nil {
13471347
t.Fatal(err)
@@ -1369,7 +1369,7 @@ func runCDCFineGrainedCheckpointingBenchmark(
13691369
// 10 keys per range are each updated maxVal + 1 times
13701370
// except for one key per range which is set to 0 before
13711371
// the changefeed starts and only updated maxVal times.
1372-
expected := 10*numRanges*(maxVal+1) - numRanges
1372+
expected := 10*params.numRanges*(params.maxVal+1) - params.numRanges
13731373
t.L().Printf("expecting %d rows", expected)
13741374

13751375
var dupes int
@@ -1388,11 +1388,6 @@ func runCDCFineGrainedCheckpointingBenchmark(
13881388
return fmt.Errorf("expected %d, got %d", expected, unique)
13891389
}
13901390

1391-
if dupes > dupeLimit {
1392-
t.Fatalf("expected dupes <= %d, got %d", dupeLimit, dupes)
1393-
return nil
1394-
}
1395-
13961391
return nil
13971392
}, 30*time.Minute)
13981393

@@ -1703,10 +1698,12 @@ func registerCDC(r registry.Registry) {
17031698
Cluster: r.MakeClusterSpec(4),
17041699
CompatibleClouds: registry.AllClouds,
17051700
Suites: registry.Suites(registry.Nightly),
1706-
Timeout: 15 * time.Minute,
1701+
Timeout: 30 * time.Minute,
17071702
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
1708-
runCDCFineGrainedCheckpointingBenchmark(ctx, t, c, 1000, 500*time.Millisecond,
1709-
[]time.Duration{
1703+
runCDCFineGrainedCheckpointingBenchmark(ctx, t, c, fineGrainedCheckpointingParams{
1704+
numRanges: 1000,
1705+
transientErrorFrequency: 500 * time.Millisecond,
1706+
rangeDelays: []time.Duration{
17101707
2 * time.Millisecond,
17111708
4 * time.Millisecond,
17121709
8 * time.Millisecond,
@@ -1717,7 +1714,9 @@ func registerCDC(r registry.Registry) {
17171714
8 * time.Millisecond,
17181715
16 * time.Millisecond,
17191716
32 * time.Millisecond,
1720-
}, 100, 50000)
1717+
},
1718+
maxVal: 100,
1719+
})
17211720
},
17221721
})
17231722
r.Add(registry.TestSpec{

0 commit comments

Comments
 (0)