Skip to content

Skip the heaviest TPC-DS / TPC-H queries on slow builds (sanitizers, debug, coverage) - #108341

Merged
alexey-milovidov merged 4 commits into
masterfrom
fix-tpc-ds-tsan-spill-timeout
Jun 27, 2026
Merged

alexey-milovidov merged 4 commits into
masterfrom
fix-tpc-ds-tsan-spill-timeout

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Jun 23, 2026 •

Copy link
Copy Markdown
Member

PR #107461 enabled disk spill (max_bytes_before_external_group_by and max_bytes_before_external_join) for the TPC-DS and TPC-H functional tests, to lower peak memory and exercise the external GROUP BY / spilling-join code paths. The spilling path is so slow that, on the instrumented and otherwise slow builds, the heaviest queries overrun the 600s per-test timeout.

The timeout cluster (04033_tpc_ds_q10, 04033_tpc_ds_q72, 04033_tpc_ds_q04, 04033_tpc_ds_q37, 04033_tpc_ds_q39, 04040_tpc_h_q08) started within hours of #107461 merging into master (2026-06-18). The timeouts are spread across all the slow builds, not only sanitizers:

  • amd_tsan / amd_msan / amd_asan_ubsan (sanitizers): q10, q39, q37, q72, 04040_tpc_h_q08 (TSan hits exactly ~600s, MSan ~508s);
  • amd_debug: q37, q72;
  • amd_llvm_coverage: q04 (which times out only here, never on sanitizers) and q72.

These are plan/result correctness tests, not performance tests. Running them in memory on the slow builds avoids the timeout but consumes too much memory, so instead this change skips the heaviest queries on the slow builds — sanitizers, debug and coverage — via the no-sanitizers, no-debug and no-llvm-coverage tags.

no-llvm-coverage reroutes these tests to the amd_binary_excluded_from_llvm job, which runs them once on a regular (non-instrumented) binary, so their plan/result correctness is still verified there and on the release/AArch64 builds. Disk spill stays enabled unconditionally in the shared libs for its original purpose (lower peak memory and exercise the spill paths); the lighter TPC queries keep exercising those paths on the instrumented builds.

Failures over the last 90 days (the query provided): https://play.clickhouse.com/play?user=play#V0lUSAogICAgOTAgQVMgaW50ZXJ2YWxfZGF5cwpTRUxFQ1QKICAgIGNoZWNrX3N0YXJ0X3RpbWUgQVMgZGF5LAogICAgcHVsbF9yZXF1ZXN0X251bWJlciBBUyBwciwKICAgIHJlcG9ydF91cmwKRlJPTSBjaGVja3MKV0hFUkUgKG5vdygpIC0gdG9JbnRlcnZhbERheShpbnRlcnZhbF9kYXlzKSkgPD0gY2hlY2tfc3RhcnRfdGltZQogICAgQU5EIHRlc3RfbmFtZSA9ICcwNDAzM190cGNfZHNfcTEwJwogICAgQU5EIHRlc3Rfc3RhdHVzIElOICgnRkFJTCcsICdFUlJPUicpCiAgICBBTkQgKHB1bGxfcmVxdWVzdF9udW1iZXIgPSAwIE9SIGJhc2VfcmVmIElOICgnbWFzdGVyJykpCiAgICBBTkQgdGVzdF9jb250ZXh0X3JhdyBMSUtFICclVGltZW91dCUnCk9SREVSIEJZIGNoZWNrX3N0YXJ0X3RpbWUgREVTQwo=

Caused by: #107461

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Version info

  • Merged into: 26.7.1.171 (included in 26.7 and later)

PR #107461 enabled disk spill (`max_bytes_before_external_group_by` and
`max_bytes_before_external_join`) for the TPC-DS and TPC-H functional tests
to lower peak memory and exercise the external `GROUP BY` / spilling-join
paths. Under sanitizer builds (especially TSan and MSan) the spilling path
is so slow that the heaviest queries overrun the 600s per-test timeout.

The timeout cluster (`04033_tpc_ds_q10`, `04033_tpc_ds_q72`,
`04033_tpc_ds_q04`, `04033_tpc_ds_q37`, `04033_tpc_ds_q39`,
`04040_tpc_h_q08`) started within hours of that PR merging into master and
hits exactly ~600s only on `amd_tsan` (`amd_msan` reaches ~508s). Before the
PR these tests ran in memory and passed on sanitizer builds for months.

These are plan/result correctness tests, not performance tests, so run them
in memory on sanitizer builds (detected via `system.build_options`), which
preserves correctness coverage there without the timeouts, while keeping
disk spill on the non-sanitizer builds where it is cheap.

Failures (last 90 days), via:
https://play.clickhouse.com/play?user=play#V0lUSAogICAgOTAgQVMgaW50ZXJ2YWxfZGF5cwpTRUxFQ1QKICAgIGNoZWNrX3N0YXJ0X3RpbWUgQVMgZGF5LAogICAgcHVsbF9yZXF1ZXN0X251bWJlciBBUyBwciwKICAgIHJlcG9ydF91cmwKRlJPTSBjaGVja3MKV0hFUkUgKG5vdygpIC0gdG9JbnRlcnZhbERheShpbnRlcnZhbF9kYXlzKSkgPD0gY2hlY2tfc3RhcnRfdGltZQogICAgQU5EIHRlc3RfbmFtZSA9ICcwNDAzM190cGNfZHNfcTEwJwogICAgQU5EIHRlc3Rfc3RhdHVzIElOICgnRkFJTCcsICdFUlJPUicpCiAgICBBTkQgKHB1bGxfcmVxdWVzdF9udW1iZXIgPSAwIE9SIGJhc2VfcmVmIElOICgnbWFzdGVyJykpCiAgICBBTkQgdGVzdF9jb250ZXh0X3JhdyBMSUtFICclVGltZW91dCUnCk9SREVSIEJZIGNoZWNrX3N0YXJ0X3RpbWUgREVTQwo=

Caused by: #107461

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [1bf7672]

Summary: ✅


AI Review

Summary

This PR skips six heavyweight TPC-DS / TPC-H stateless query tests on sanitizer, debug, and LLVM coverage builds by adding no-sanitizers, no-debug, and no-llvm-coverage tags. The current code matches the stated CI-fix scope, and the prior q04 coverage-only timeout concern is addressed by the added no-llvm-coverage tag.

Final Verdict

✅ No blocker or major findings. I did not post any new inline review comments.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jun 23, 2026
Replace the per-build disk-spill gating with simply skipping the heaviest
queries on sanitizer builds via the `no-sanitizers` tag, and restore the
shared libs (`04033_tpc_ds.lib`, `04040_tpc_h.lib`) to their original
unconditional disk-spill settings.

Running these queries in memory on sanitizers (the previous approach in this
PR) avoided the timeout but consumed too much memory; leaving disk spill on
made them overrun the 600s test timeout under TSan/MSan. They are plan/result
correctness tests whose correctness is already covered on debug, release and
coverage builds, so skipping them under sanitizers is the cleaner trade-off.

Disk spill stays enabled unconditionally in the shared libs - its original
purpose is to lower peak memory and exercise the external `GROUP BY` /
spilling-join paths on the builds that still run these tests.

Affected tests: `04033_tpc_ds_q10`, `04033_tpc_ds_q72`, `04033_tpc_ds_q04`,
`04033_tpc_ds_q37`, `04033_tpc_ds_q39` and `04040_tpc_h_q08`.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@alexey-milovidov alexey-milovidov changed the title Skip disk spill for TPC-DS / TPC-H functional tests on sanitizer builds Skip the heaviest TPC-DS / TPC-H queries on sanitizer builds Jun 24, 2026

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexey-milovidov
alexey-milovidov requested a review from rienath June 24, 2026 00:21

@rienath rienath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related: #107968

These timeouts are worth fixing, but I'd rather test these in memory (raise the spill threshold, or set it back to the default 0 = no spill) than skip them:

  1. This won't fully turn CI green. no-sanitizers only skips tsan/asan/ubsan/msan, but these queries also time out on non-sanitizer builds: q04 under the llvm coverage build, q37 under parallel amd debug, q72 too, etc. Those
    timeouts stay red.
  2. Spill is what's slow, not the queries. q10 (amd_tsan) and q04 (coverage) had zero timeouts until #107461 merged. Skipping (or re-tuning the threshold) treats the symptom.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

@rienath, all tests are run under sanitizers (regardless of tags) in the Stress test. You can be sure they are covered.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

Spill is what's slow, not the queries. q10 (amd_tsan) and q04 (coverage) had zero timeouts until #107461 merged. Skipping (or re-tuning the threshold) treats the symptom.

But without spill, we do not have enough memory to run them in parallel. Spill gives better coverage.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

@groeneai, provide a fix for 04299_move_assignment_memory_limit.

@groeneai

Copy link
Copy Markdown
Collaborator

@alexey-milovidov, 04299_move_assignment_memory_limit is already fixed by #108273, merged 2026-06-24 08:58 UTC. It caps the {1..500} loop at 60 seconds of wall-clock, which is what blew past the run timeout on the slow configs: each iteration spawns a fresh client, so process startup dominates under msan/WasmEdge and tsan/s3, and 500 iterations overran the per-test timeout. A buggy build still crashes within a few dozen iterations, so detection is preserved.

This PR's only 04299 failure was 2026-06-24 01:28 UTC (amd_msan, WasmEdge), about 7.5h before that merge, so its base predates the fix. CIDB shows 0 failures of any mode since 08:58 UTC across master and all PRs. Merging master / rebasing here picks it up; no further test change is needed.

…uilds

The previous change only added `no-sanitizers`, but the post-#107461 disk-spill
timeouts also occur on non-sanitizer slow builds:

  - `04033_tpc_ds_q04` times out *only* in `Stateless tests (amd_llvm_coverage,
    ParallelReplicas, s3 storage, parallel)` (5 rows, 2026-06-19..2026-06-25),
    never on sanitizers, so `no-sanitizers` did nothing for it.
  - `04033_tpc_ds_q72` also times out on `amd_debug` and `amd_llvm_coverage`.
  - `04033_tpc_ds_q37` also times out once on `amd_debug`.

In `tests/clickhouse-test`, `no-sanitizers` only matches ASan/MSan/TSan/UBSan
(`BuildFlags.SANITIZERS`), so the coverage and debug builds were left exposed.
Since the disk spill enabled by #107461 is slow on every instrumented/slow build,
skip the six heaviest queries on debug and coverage as well via `no-debug` and
`no-llvm-coverage`.

`no-llvm-coverage` reroutes these tests to the `amd_binary_excluded_from_llvm` job,
which runs them once on a regular (non-instrumented) binary, so their plan/result
correctness is still verified without the timeout. The lighter TPC queries keep
exercising the spill code paths on instrumented builds.

CI report: #108341

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@alexey-milovidov alexey-milovidov changed the title Skip the heaviest TPC-DS / TPC-H queries on sanitizer builds Skip the heaviest TPC-DS / TPC-H queries on slow builds (sanitizers, debug, coverage) Jun 27, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.30% 85.30% +0.00%
Functions 92.60% 92.60% +0.00%
Branches 77.60% 77.50% -0.10%

Changed lines: No C/C++ source files changed — skipping uncovered code analysis.

Newly covered by added/modified tests: 313 line(s), 27 function(s) across 116 file(s) · Details

Top files
  • src/Backups/BackupEntriesCollector.cpp: 25 line(s), 2 function(s)
  • src/Functions/UserDefined/ExternalUserDefinedExecutableFunctionsLoader.cpp: 21 line(s), 1 function(s)
  • src/Common/ZooKeeper/ZooKeeper.cpp: 12 line(s), 2 function(s)
  • src/Databases/DatabaseFactory.cpp: 11 line(s)
  • src/AggregateFunctions/TimeSeries/AggregateFunctionTimeSeriesGroupArray.h: 10 line(s), 8 function(s)

Full report

@alexey-milovidov alexey-milovidov self-assigned this Jun 27, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jun 27, 2026
Merged via the queue into master with commit b3891f8 Jun 27, 2026
169 checks passed
@alexey-milovidov
alexey-milovidov deleted the fix-tpc-ds-tsan-spill-timeout branch June 27, 2026 18:28
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 27, 2026
alexey-milovidov added a commit that referenced this pull request Jun 27, 2026
Resolve tag-line conflicts in the TPC-DS/TPC-H tests by taking the union
of both tag sets: master's `no-sanitizers, no-debug, no-llvm-coverage`
(added in #108341) and this branch's `no-random-detach`.

Move the `reattach_tables_before_query_execution` and
`reattach_tables_before_query_execution_probability` entries in
`SettingsChangesHistory.cpp` from the now-released `26.6` block to the
current in-development `26.7` block; master opened `26.7` in 407ba80
("Adjust settings after 26.6 release"), and a clean auto-merge would
otherwise strand them in a released version.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…uilds

The previous change only added `no-sanitizers`, but the post-ClickHouse#107461 disk-spill
timeouts also occur on non-sanitizer slow builds:

  - `04033_tpc_ds_q04` times out *only* in `Stateless tests (amd_llvm_coverage,
    ParallelReplicas, s3 storage, parallel)` (5 rows, 2026-06-19..2026-06-25),
    never on sanitizers, so `no-sanitizers` did nothing for it.
  - `04033_tpc_ds_q72` also times out on `amd_debug` and `amd_llvm_coverage`.
  - `04033_tpc_ds_q37` also times out once on `amd_debug`.

In `tests/clickhouse-test`, `no-sanitizers` only matches ASan/MSan/TSan/UBSan
(`BuildFlags.SANITIZERS`), so the coverage and debug builds were left exposed.
Since the disk spill enabled by ClickHouse#107461 is slow on every instrumented/slow build,
skip the six heaviest queries on debug and coverage as well via `no-debug` and
`no-llvm-coverage`.

`no-llvm-coverage` reroutes these tests to the `amd_binary_excluded_from_llvm` job,
which runs them once on a regular (non-instrumented) binary, so their plan/result
correctness is still verified without the timeout. The lighter TPC queries keep
exercising the spill code paths on instrumented builds.

CI report: ClickHouse#108341

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…spill-timeout

Skip the heaviest TPC-DS / TPC-H queries on slow builds (sanitizers, debug, coverage)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants