Skip to content

Commit 4595a31

Browse files
craig[bot]aerfreijeffswensondhartunianrytaft
committed
152702: changefeedccl: increase timeout for test making many tables r=log-head a=aerfrei This test timed out in CI while trying to create 50000 tables. After an hour, it created about 40,000. Adding another hour should be enough time to finish creation and run the 20 minute workload. We also saw a test failure where this pts management metric came in slightly above the threshold of 25ms, so we raise that to 30ms. Epic: none Fixes: #152654 Fixes: #152962 Release note: None 152933: crosscluster: fix error handling in computeRangeStats r=jeffswenson a=jeffswenson `computeRangeStats` was returning `err` when it should have returned `lazyIterator.Error`. The code calling this is best effort, so returning success is not a critical bug. But it does mean we would miss a warning log. Release note: none Epic: none 152999: statusccl: fix TestTenantStatusAPI with sync stats r=dhartunian a=dhartunian Resolves: #151886 Epic: None Release note: None 153043: sqlsmith: fix potential panic when creating stats on 0-column table r=rytaft a=rytaft This commit avoids a panic by adding a check for 0 columns before calling `rand.Intn(len(columns))`. There is no release note since this is a test-only change. Release note: None Co-authored-by: Aerin Freilich <[email protected]> Co-authored-by: Jeff Swenson <[email protected]> Co-authored-by: David Hartunian <[email protected]> Co-authored-by: Rebecca Taft <[email protected]>
5 parents ac39c2e + f9a6276 + 2526c4b + 63dbd0d + 6c05044 commit 4595a31

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

pkg/ccl/serverccl/statusccl/tenant_status_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ func TestTenantStatusAPI(t *testing.T) {
5757
ctx := context.Background()
5858

5959
var knobs base.TestingKnobs
60-
knobs.SQLStatsKnobs = sqlstats.CreateTestingKnobs()
60+
61+
sqlStatsKnobs := sqlstats.CreateTestingKnobs()
62+
sqlStatsKnobs.SynchronousSQLStats = true
63+
64+
knobs.SQLStatsKnobs = sqlStatsKnobs
6165
knobs.SpanConfig = &spanconfig.TestingKnobs{
6266
// Some of these subtests expect multiple (uncoalesced) tenant ranges.
6367
StoreDisableCoalesceAdjacent: true,

pkg/cmd/roachtest/tests/cdc.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,7 @@ func runCDCMultiTablePTSBenchmark(
18721872
ct.verifyMetrics(ctx, ct.verifyMetricsUnderThreshold([]string{
18731873
"changefeed_stage_pts_manage_latency",
18741874
"changefeed_stage_pts_create_latency",
1875-
}, float64(25*time.Millisecond)))
1875+
}, float64(30*time.Millisecond)))
18761876

18771877
t.Status("multi-table PTS benchmark finished")
18781878
}
@@ -2912,12 +2912,13 @@ func registerCDC(r registry.Registry) {
29122912

29132913
for _, perTablePTS := range []bool{false, true} {
29142914
for _, config := range []struct {
2915-
numTables int
2916-
numRanges int
2915+
numTables int
2916+
numRanges int
2917+
timeoutHours int
29172918
}{
2918-
{numTables: 500, numRanges: 10},
2919-
{numTables: 5000, numRanges: 10},
2920-
{numTables: 50000, numRanges: 1}, // Splitting tables into ranges slows down test setup at this scale
2919+
{numTables: 500, numRanges: 10, timeoutHours: 1},
2920+
{numTables: 5000, numRanges: 10, timeoutHours: 1},
2921+
{numTables: 50000, numRanges: 1, timeoutHours: 2}, // Splitting tables into ranges slows down test setup at this scale
29212922
} {
29222923
r.Add(registry.TestSpec{
29232924
Name: fmt.Sprintf("cdc/multi-table-pts-benchmark/per-table-pts=%t/num-tables=%d/num-ranges=%d", perTablePTS, config.numTables, config.numRanges),
@@ -2926,7 +2927,7 @@ func registerCDC(r registry.Registry) {
29262927
Cluster: r.MakeClusterSpec(4, spec.CPU(16), spec.WorkloadNode()),
29272928
CompatibleClouds: registry.AllClouds,
29282929
Suites: registry.Suites(registry.Nightly),
2929-
Timeout: 1 * time.Hour,
2930+
Timeout: time.Duration(config.timeoutHours) * time.Hour,
29302931
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
29312932
params := multiTablePTSBenchmarkParams{
29322933
numTables: config.numTables,

pkg/crosscluster/producer/range_stats.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func computeRangeStats(
108108
}
109109
}
110110
if lazyIterator.Error() != nil {
111-
return streampb.StreamEvent_RangeStats{}, err
111+
return streampb.StreamEvent_RangeStats{}, lazyIterator.Error()
112112
}
113113
}
114114
return stats, nil

pkg/internal/sqlsmith/relational.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,9 @@ func makeCreateStats(s *Smither) (tree.Statement, bool) {
19401940
s.rnd.Shuffle(len(columns), func(i, j int) {
19411941
columns[i], columns[j] = columns[j], columns[i]
19421942
})
1943-
columns = columns[0:s.rnd.Intn(len(columns))]
1943+
if len(columns) > 0 {
1944+
columns = columns[0 : s.rnd.Intn(len(columns))+1]
1945+
}
19441946
}
19451947

19461948
var options tree.CreateStatsOptions

0 commit comments

Comments
 (0)