Skip to content

Revert "Temporarily disable server-side AST fuzzer in Stress Test and BuzzHouse [2]" - #101354

Merged
alexey-milovidov merged 63 commits into
masterfrom
revert-101274-revert-100490-revert-100439-disable-ast-fuzzer-stress-buzzhouse
Jun 14, 2026
Merged

alexey-milovidov merged 63 commits into
masterfrom
revert-101274-revert-100490-revert-100439-disable-ast-fuzzer-stress-buzzhouse

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Mar 31, 2026 •

Copy link
Copy Markdown
Member

Reverts #101274

As soon as we are ready.

Version info

  • Merged into: 26.6.1.791

@clickhouse-gh

clickhouse-gh Bot commented Mar 31, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [184fe40]

Summary: ✅


AI Review

Summary

This PR re-enables the server-side AST fuzzer in the regular Stress, AST Fuzzer, and BuzzHouse jobs, removes the now-duplicate dedicated serverfuzz job matrices and env plumbing, and tightens FuzzQuery length handling with focused regression coverage. I reviewed the current combined diff and prior discussion; the previously raised issues are either fixed in the current code or were explicitly accepted by the author as an intentional tradeoff. I did not find a new actionable blocker or major issue.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Mar 31, 2026
@nikitamikhaylov nikitamikhaylov self-assigned this Mar 31, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

The MSan stress test failure (MemorySanitizer: use-of-uninitialized-value, STID 4179-5154 or 4148-3044) is a known pre-existing issue unrelated to this PR. Fix: #102158

@clickhouse-gh clickhouse-gh Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Submitting pending review to allow standalone inline comments from automation.

alexey-milovidov and others added 2 commits April 26, 2026 00:34
…t-100490-revert-100439-disable-ast-fuzzer-stress-buzzhouse

# Conflicts:
#	tests/docker_scripts/stress_tests.lib
Since this PR re-enables the AST fuzzer globally for stress and BuzzHouse
jobs, the conditional `ENABLE_SERVER_FUZZER` / `SERVER_FUZZER_ENABLED`
opt-in path and the dedicated `experimental, serverfuzz, ...` job
parametrizations are now redundant. Drop them along with the
auto-generated workflow YAML entries.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@clickhouse-gh clickhouse-gh Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Submitting stale pending review to allow fresh standalone inline comments from automation.

alexey-milovidov and others added 4 commits April 26, 2026 02:34
…t-100490-revert-100439-disable-ast-fuzzer-stress-buzzhouse
The check that resets the fuzzer's working AST back to the original query
when the fuzzed text grows too long was comparing the *configured* length
limit against the constant 500, instead of the *fuzzed text size* against
the configured limit. With the default `max_query_length = 500`, the
condition was always false, so the AST kept growing across iterations and
each subsequent `formatForErrorMessage` call became progressively more
expensive — producing hangs in stress tests that exercise `fuzzQuery` with
the server-side AST fuzzer enabled (`ast_fuzzer_runs > 0`,
`ast_fuzzer_any_query = 1`), as observed in CI:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=101354&sha=52e5fa626ce929f39bbc4e171def47bacaf6a504&name_0=PR&name_1=Stress%20test%20%28arm_release%29

PR: #101354

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The previous `serverfuzz` opt-in path enabled both `ast_fuzzer_runs` and
`ast_fuzzer_any_query` together. Removing that path and only adding
`ast_fuzzer_runs` to `query-fuzzer-tweaks-users.xml` left the AST Fuzzer
job covering only read-only queries. Add `ast_fuzzer_any_query` so DDL
and `INSERT` queries are also fuzzed, matching the original coverage.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Comment thread src/Storages/StorageFuzzQuery.cpp Resolved
…t-100490-revert-100439-disable-ast-fuzzer-stress-buzzhouse
The previous `if (config.max_query_length > 500)` check was independent of
`fuzzed_text.size()`: for `max_query_length <= 500` the cap was never
enforced (rows could grow unbounded), and for `max_query_length > 500` the
loop always restarted from the original query without producing any rows.

Address review feedback on #101354
…t-100490-revert-100439-disable-ast-fuzzer-stress-buzzhouse
Comment thread src/Storages/StorageFuzzQuery.cpp Resolved
alexey-milovidov and others added 2 commits April 29, 2026 14:32
`max_query_length = 0` would otherwise drive `FuzzQuerySource::createColumn`
into an infinite loop: every non-empty fuzzed AST exceeds the cap, the loop
resets to the original query, and `row_num` never increments past `block_size`.
Validate the value in `StorageFuzzQuery::getConfiguration` and throw
`BAD_ARGUMENTS`. Add a regression test alongside the existing length-cap test.

Address review feedback on #101354

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…t-100490-revert-100439-disable-ast-fuzzer-stress-buzzhouse
@alexey-milovidov

Copy link
Copy Markdown
Member Author

@groeneai, investigate the hung check failure, and send a fix as a separate PR.

@groeneai

Copy link
Copy Markdown
Collaborator

@alexey-milovidov, root cause and fix posted as a separate PR per your request: #103742.

The hung query (https://s3.amazonaws.com/clickhouse-test-reports/PRs/101354/5da866fbdbe5ef63d3498b9030b65987626e9dce/stress_test_arm_tsan/hung_check.log) is 04141_fuzz_query_max_query_length itself, executed via executeASTFuzzerQueries with ast_fuzzer_runs=5. The AST fuzzer mutated the test's max_query_length literal into a value that put FuzzQuerySource::createColumn into an unbounded retry loop — is_cancelled=1 but the thread is stuck in user code with no isCancelled check, so KILL QUERY and the 10s max_execution_time cap inside executeASTFuzzerQueries could not stop it.

The same hang shape exists on master HEAD without your PR: SELECT * FROM fuzzQuery('SELECT 1', 600, 42) LIMIT 1 hangs because the existing if (config.max_query_length > 500) guard always resets and continues. With the tighter if (fuzzed_text.size() > config.max_query_length) check from this PR the same shape also reaches small caps. #103742 fixes both: caps retries per row, falls back to the unfuzzed query, and adds isCancelled to the loop. It also adds a regression test (04143_fuzz_query_no_infinite_loop) covering caps above 500, at the threshold, and below the unmutated query length.

PR #103742 is orthogonal to this one — whichever lands first, the other becomes a small rebase.

groeneai added a commit to groeneai/ClickHouse that referenced this pull request Apr 30, 2026
Folds in the source-code changes from PR ClickHouse#101354 in response to the bot
review on PR ClickHouse#103742 ("wasted attempts at max_query_length > 500").

Two combined changes:

1. Replace the lazy `if (config.max_query_length > 500)` guard with the
   precise `if (fuzzed_text.size() > config.max_query_length)` check.

   The old guard was a coarse heuristic: it triggered the reset branch
   whenever the cap was larger than 500, regardless of the actual fuzzed
   AST size. With the 100-attempt cap added in 614df1d the source
   no longer hangs, but every row in the `cap > 500` case still does
   100 full fuzz-and-format cycles before falling back to the unfuzzed
   query — `O(max_attempts_per_row * block_size)` wasted work per scan.

   The precise check resets only when the produced fuzzed text actually
   exceeds the cap. For the common case `cap > 500` with a small input
   query, the loop now produces a row on the first attempt:

     SELECT count() FROM (SELECT * FROM fuzzQuery('SELECT 1', 1000, 42)
     LIMIT 1000);
     -- 113 ms (vs ~10 s with 100 wasted attempts per row).

   The 100-attempt cap stays in place as defense-in-depth for genuine
   oversized-variant cases (e.g. `max_query_length = 1`, where every
   non-trivial mutation overflows).

2. Reject `max_query_length = 0` in `getConfiguration` with
   `BAD_ARGUMENTS`. With cap = 0, every non-empty fuzzed AST exceeds
   the cap by definition, so the source would degrade to emitting the
   unfuzzed query for every row (after `max_attempts_per_row` retries).
   That is a no-op fuzzer with extra cost; the user clearly did not
   mean to ask for it.

Both changes were originally proposed in PR ClickHouse#101354
(ClickHouse#101354). With them
folded in here, PR ClickHouse#101354 only needs to keep its workflow / CI
re-enablement bits.

Test:
- `04143_fuzz_query_no_infinite_loop` adds a fourth scenario for the
  `max_query_length = 0` `BAD_ARGUMENTS` rejection.
- 50/50 passes via `clickhouse-test --test-runs 50`.
- `fuzzQuery('SELECT 1', 1000, 42) LIMIT 1000` returns in 113 ms.
- `max_execution_time = 1` exits within ~5 ms of the deadline.

Bot review: ClickHouse#103742 (comment)
Related: ClickHouse#101354

Co-Authored-By: Claude Opus 4.7 <[email protected]>
…t-100490-revert-100439-disable-ast-fuzzer-stress-buzzhouse
@clickhouse-gh

clickhouse-gh Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.40% 84.40% +0.00%
Functions 91.40% 91.40% +0.00%
Branches 76.90% 77.00% +0.10%

Changed lines: Changed C/C++ lines covered by tests: 3/3 (100.00%) | Lost baseline coverage: none · Uncovered code

Full report · Diff report

…t-100490-revert-100439-disable-ast-fuzzer-stress-buzzhouse

# Conflicts:
#	src/Functions/runningAccumulate.cpp
@clickhouse-gh

clickhouse-gh Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Dear @nikitamikhaylov, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself.

@groeneai

groeneai commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Closing the loop on the 01710_projection_additional_filters directive (Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel)).

This was a real master regression, not flaky: ParallelReplicas was not applying additional_table_filters on remote replicas, so the test returned 13 instead of the expected 3. It was introduced by PR #102921 (merged 2026-05-04) and tracked as issue #104219.

Fixed by PR #104296 ("Disable additional_table_filters with parallel replicas and analyzer and w/o query plan serialization", azat), merged 2026-05-20T12:57:37Z (commit f53680904fe).

CIDB confirms the fix held: the last failure anywhere was 2026-05-20 16:03 (a couple of PR branches whose merge-base predated the fix), and zero failures on master or any PR in the ~2 weeks since. The CI run that flagged it here was from before the fix landed, so a rebase clears it.

…t-100490-revert-100439-disable-ast-fuzzer-stress-buzzhouse
@alexey-milovidov

Copy link
Copy Markdown
Member Author

Merged the latest master (the branch was ~1337 commits / 6 days behind) to get a fresh CI run with the server-side AST fuzzer re-enabled.

Notes from the merge:

  • Clean merge, no conflicts. All four added/skipped tests survived without renumbering.
  • The runningAccumulate insertMergeResultInto MSan fix has already landed on master via a separate PR — identical to this branch's version — so it dropped out of this PR's net diff, and 04209_running_accumulate_state_combinator remains here purely as regression coverage.
  • The StorageFuzzQuery.cpp source changes (precise fuzzed_text.size() > config.max_query_length check and the max_query_length == 0 / cap-smaller-than-base BAD_ARGUMENTS rejections) are not on master yet — Bound retries in FuzzQuerySource to prevent hung queries #103742 (which folds them in) is still open — so this PR correctly still carries them.
  • The actual re-enablement is unconditional ast_fuzzer_runs / ast_fuzzer_any_query in tests/docker_scripts/stress_tests.lib and query-fuzzer-tweaks-users.xml; the workflow YAML changes net to the master tip.

Verified locally on the merged tree (built clean, server 26.6.1.1):

  • 04141_fuzz_query_max_query_length, 04209_running_accumulate_state_combinator, 02920_rename_column_of_skip_indices, 03714_base32_base58_short_string — all 4 pass.
  • fuzzQuery('...', 200, 42) returns 100 rows all within the cap (no hang / no fallback overflow); max_query_length = 0 and a cap smaller than the formatted base query both throw BAD_ARGUMENTS as designed.

The previously-flagged failures (01710_projection_additional_filters, 04103_user_network_bandwidth_throttler, the MSan stress failure, and the hung check) were all real master issues since fixed or tracked separately, and are cleared by this rebase. All 9 review threads are resolved.

alexey-milovidov and others added 3 commits June 7, 2026 09:04
Now that `ast_fuzzer_runs` and `ast_fuzzer_any_query` are enabled
unconditionally for the regular AST Fuzzer, BuzzHouse and Stress Test
jobs (via `query-fuzzer-tweaks-users.xml` and `stress_tests.lib`), the
separate `experimental, serverfuzz, ...` job matrices only duplicate the
same coverage and waste CI resources without adding signal.

Remove the `stress_test_serverfuzz_jobs` and `buzz_fuzzer_serverfuzz_jobs`
job configs along with their now-dead plumbing:
- `ENABLE_SERVER_FUZZER` in `stress_job.py`,
- `SERVER_FUZZER_ENABLED` in `ast_fuzzer_job.py` and `run-fuzzer.sh`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…t-100490-revert-100439-disable-ast-fuzzer-stress-buzzhouse
Regenerated from the workflow configs with `python3 -m ci.praktika yaml`
after removing the `experimental, serverfuzz, ...` job matrices, so the
generated GitHub Actions workflow matches `ci/workflows/master.py`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

Addressed the review feedback and refreshed the branch:

  • Removed the dedicated experimental, serverfuzz, ... CI job matrices (stress_test_serverfuzz_jobs, buzz_fuzzer_serverfuzz_jobs) and their now-dead env plumbing (ENABLE_SERVER_FUZZER in stress_job.py, SERVER_FUZZER_ENABLED in ast_fuzzer_job.py and run-fuzzer.sh). The server-side AST fuzzer is now enabled unconditionally for the regular AST Fuzzer, BuzzHouse and Stress Test jobs via query-fuzzer-tweaks-users.xml and stress_tests.lib, so the separate matrices only duplicated coverage.
  • Regenerated .github/workflows/master.yml with python3 -m ci.praktika yaml so the generated workflow matches the configs (596 lines of serverfuzz jobs dropped).
  • Merged current master (the branch was ~464 commits behind); no conflicts.

The previous CH Inc sync failure was due to the stale branch; it will re-run on this fresh merge.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

@groeneai, check the UBSan report and provide the fix.

@groeneai

groeneai commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

@alexey-milovidov, the Stress test (arm_ubsan) job on c701c6a7af0233cd0286e5230b4a5134d3c90688 timed out at 3h (Hung check failed, exit -15). The triggering hung query is:

SELECT * FROM url('http://[2001:db8:1::2]:36967/','JSONAsString')

This came from 02205_HTTP_user_agent.sh after the AST fuzzer mutated the URL parameter to the unreachable RFC 3849 documentation address. The query had is_cancelled=1 after 197s but the thread was stuck in clock_nanosleep from DB::ReadWriteBufferFromHTTP::doWithRetries. Stack:

sleepForNanoseconds
DB::ReadWriteBufferFromHTTP::doWithRetries
DB::ReadWriteBufferFromHTTP::getHeadResponse
DB::ReadWriteBufferFromHTTP::getFileInfo
...
DB::StorageURLSource::generate

Root cause: doWithRetries (src/IO/ReadWriteBufferFromHTTP.cpp:399) calls sleepForMilliseconds(milliseconds_to_wait) between retry attempts and never checks query cancellation while sleeping. With http_max_tries=10 and exponential backoff capped at 10000ms, the loop can sleep for up to ~50s per HTTP operation; KILL QUERY and max_execution_time cannot interrupt it. (The HEAD-then-GET sequence on a fully unreachable host stretches that further.)

A fix is already in flight: #104089 ("Improve canceling queries with url() function", rvasin). It adds a CheckCancelled callback to ReadWriteBufferFromHTTP, threads it through BuilderRWBufferFromHTTP, calls it between retry attempts in doWithRetries, and StorageURLSource passes its isCancelled() in. That PR has been open since 2026-05-05 and is the third attempt at this fix (replaces reverted #102801 / #104014). It directly addresses the failing case here. Please review #104089 — no separate fix PR from me would be different in shape.

Two unrelated failures on this run:

Tracked on our side as monitoring_external against #104089.

…t-100490-revert-100439-disable-ast-fuzzer-stress-buzzhouse
@alexey-milovidov

Copy link
Copy Markdown
Member Author

Merged the latest master to refresh CI (the branch was ~389 commits behind).

  • Clean merge, no conflicts. The PR's net diff is unchanged: the unconditional ast_fuzzer_runs / ast_fuzzer_any_query re-enablement in query-fuzzer-tweaks-users.xml and stress_tests.lib, the StorageFuzzQuery max_query_length changes (still not on master — Bound retries in FuzzQuerySource to prevent hung queries #103742 is open), and the four regression tests all survived. Regenerating master.yml with python3 -m ci.praktika yaml produced no diff, so the dropped serverfuzz job matrices stay consistent with the configs.

Status of the previously-flagged failures:

…= 0`

Master commit `af74a133dba` removed the `no-stress` tag (it never had any
effect: support for it was reverted long ago in `bddead1ea21`) and made
`tests/clickhouse-test` raise an error when any test declares it. After
merging that into this branch, the three tests here that still carried the
tag crashed the test runner during tag parsing, which is why the `Fast test`
job failed with "The test runner was terminated unexpectedly" and all
downstream jobs were skipped:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=101354&sha=2514b4c7958098eb21ad2596431b1095d0c6d845&name_0=PR&name_1=Fast%20test

Since the tag was a no-op, these stress-test skips were vacuous anyway.
Replace them with a mechanism that actually works and keeps the tests
running in the Stress test: disable the server-side AST fuzzer only for the
specific queries it cannot safely mutate, via a `SETTINGS ast_fuzzer_runs = 0`
clause. The fuzz decision in `executeQuery.cpp` reads the setting from the
query context after the query-level `SETTINGS` clause is applied, and the
stress configuration places no constraint on it, so the per-query opt-out
takes effect while every other query in these tests remains fuzzed.

PR: #101354

Co-Authored-By: Claude Fable 5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

Fixed the Fast test failure ("The test runner was terminated unexpectedly") that skipped the whole pipeline on 2514b4c7958.

Root cause: master commit af74a133dba removed the no-stress tag (it never had any effect — support for it was reverted long ago in bddead1ea21) and made tests/clickhouse-test raise an error when any test declares it. After the last master merge, the three tests in this branch that still carried the tag (02920_rename_column_of_skip_indices, 03714_base32_base58_short_string, 04141_fuzz_query_max_query_length) crashed the runner during tag parsing — before any test ran — so Fast test died in under a second and everything downstream was skipped. Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=101354&sha=2514b4c7958098eb21ad2596431b1095d0c6d845&name_0=PR&name_1=Fast%20test

Since the tag was a no-op, those stress-test skips were vacuous anyway. Pushed 696851163d8 replacing them with a mechanism that actually works: the specific queries the server-side AST fuzzer cannot safely mutate now opt out individually via a SETTINGS ast_fuzzer_runs = 0 clause (the fuzz decision in executeQuery.cpp reads the setting after the query-level SETTINGS clause is applied, and the stress configuration places no constraint on it). The tests themselves keep running in the Stress test, and every other query in them remains fuzzed — consistent with "stress tests must be able to run every test".

Verified locally: 02920 and 03714 match their references with clickhouse-local, and the modified 04141 queries parse and execute (the cap assertion itself needs this branch's StorageFuzzQuery fix, so CI is the real check there).

The CH Inc sync red is stale — the private sync PR last synced on 2026-05-29 and will refresh from this push. The gating fixes #104089 (url() cancellation, for the 02205_HTTP_user_agent.sh hung check) and #103742 (FuzzQuerySource retry bound) are both still open.

…t-100490-revert-100439-disable-ast-fuzzer-stress-buzzhouse
@clickhouse-gh

clickhouse-gh Bot commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

🟢 AI verdict: improvement — 3 query(s) improved out of 38 analysed

This PR removes the experimental serverfuzz CI jobs and refactors the fuzzQuery table-function storage (StorageFuzzQuery.cpp); it does not touch the scan, join, or aggregation paths that the flagged queries run. All four flagged results are improvements that fall outside the changed code, so none can be attributed to this change. Clickbench Q22 (-22.6%) is downgraded to not-sure as off-path variance; Q23 (-33%), TPCH Q7 (-36%) and Q20 (-49%) show deltas large and consistent enough that the gates retain them, but they correspond to no code change here and most likely reflect build/baseline measurement differences — Q20 in particular was measured on a noisy query. Treat these as informational, not as a verified speedup from this PR.

clickbench

🟢 1 improved · ⚠️ 1 inconclusive

Flagged queries (2 of 43)
Query Verdict Baseline med (ms) PR med (ms) Change q-value Hint
🟢 23 improvement 297 199 -33.0% <0.0001 -33% is large and consistent so the gate retains it, but the diff only touches fuzzQuery tooling, not Q23's path
⚠️ 22 not_sure 334 258 -22.6% <0.0001 PR only touches CI serverfuzz jobs + fuzzQuery storage; nothing in CB Q22's execution path changed

q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

tpch_adapted_1_official

🟢 2 improved

Flagged queries (2 of 22)
Query Verdict Baseline med (ms) PR med (ms) Change q-value Hint
🟢 7 improvement 113 72 -36.3% <0.0001 -36% large/consistent delta stands on its own; diff is CI + fuzzQuery storage only, not TPCH Q7 execution
🟢 20 improvement 248 128 -48.6% <0.0001 -49% large delta retained, but this query is noisy (base spread ~88%) and the PR doesn't touch its path

q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

Debug info
  • StressHouse run: 1f0ec727-872f-4de5-b24f-021adceebbd7
  • MIRAI run: 1622c61b-5d4d-4ca8-8f5b-6734a66e59db
  • PR check IDs:
    • clickbench_78889_1781412476
    • clickbench_79050_1781412512
    • clickbench_79070_1781412512
    • tpch_adapted_1_official_79249_1781412578
    • tpch_adapted_1_official_79270_1781412578
    • tpch_adapted_1_official_79421_1781412614

@alexey-milovidov
alexey-milovidov merged commit 44f53e8 into master Jun 14, 2026
165 of 166 checks passed
@alexey-milovidov
alexey-milovidov deleted the revert-101274-revert-100490-revert-100439-disable-ast-fuzzer-stress-buzzhouse branch June 14, 2026 18:42
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 14, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
`isProbablePrime` on `UInt128`/`UInt256` delegated to `boost::multiprecision::miller_rabin_test`, which has no
cancellation hook. Under heavy sanitizer + ThreadFuzzer instrumentation, a single round can stretch into
minutes; combined with the server-side AST fuzzer mutating the `rounds` literal, the function hangs the
stress test's `hung_check` for the full 30-minute window.

This commit:
- Adapts Boost's Miller-Rabin loop locally and calls `QueryStatus::checkTimeLimit` between rounds, so
  `KILL QUERY` and `max_execution_time` both interrupt the function.
- Rejects `rounds > 256` with `BAD_ARGUMENTS`. `4^-256 < 10^-150` already, so larger values add no
  meaningful confidence and only widen the worst-case runtime under the AST fuzzer.

See CI report on the AST-fuzzer-re-enablement PR:
ClickHouse#101354
https://s3.amazonaws.com/clickhouse-test-reports/PRs/101354/f0038d26f27dc2d179136ae371e632746bab3c30/stress_test_arm_tsan/hung_check.log

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog 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