Skip to content

Do not run the AST fuzzer in the stress job's system log export - #133786

Merged
PedroTadim merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/stress-log-export-no-ast-fuzzer
Nov 24, 2026
Merged

PedroTadim merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/stress-log-export-no-ast-fuzzer

Conversation

@groeneai

@groeneai groeneai commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #114734

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):

...

Description

collect_query_and_trace_logs in tests/docker_scripts/stress_tests.lib exports the system logs with clickhouse-local --config-file=/etc/clickhouse-server/config.xml, which loads the stress default profile (ast_fuzzer_runs = 5, ast_fuzzer_any_query = true). So after each export query clickhouse-local runs up to 5 fuzzed variants of it before it exits. Their results are discarded, and one of them can take over an hour: in 3 Stress test (amd_tsan) runs on 2026-11-20 and 2026-11-21 the metric_log export took 64-72 min, each time in a variant like SELECT * FROM merge(REGEXP('(?i)SYSTEM'), 'metric_log') building the plan for the system.metric_log child (Timeout exceeded: elapsed 4248469 ms, maximum: 10000 ms) (1, 2, 3). With a 60 min stress phase this pushed a job past its 3 h timeout, and it uploaded no result at all (report).

The export now passes --ast_fuzzer_runs 0, as stress.py and setup_log_cluster.sh already do for harness statements; the stress run itself keeps the fuzzer. Both callers, stress_runner.sh and upgrade_runner.sh, run the new binary at that point.

Validated locally with the stress profile over a populated server data directory: the function ran 20 fuzzed queries on master (5 per table) and 0 with this change, and the four exported files are identical.

Not changed here: the merge() child planning that ignores max_execution_time for over an hour is a separate engine issue, and in some runs the query_log/trace_log dumps stop at the profile's 1G max_result_bytes (Code: 396).


Workflow [PR]
Sync PR [sync-upstream/pr/133786]

Version info

  • Merged into: 26.12.1.353-master (included in 26.12 and later)

`collect_query_and_trace_logs` exports the system logs with
`clickhouse-local --config-file=/etc/clickhouse-server/config.xml`, which loads
the stress `default` profile (`ast_fuzzer_runs = 5`, `ast_fuzzer_any_query =
true`). After each export query `clickhouse-local` therefore runs up to 5
fuzzed variants of it synchronously before exiting. Their results are
discarded, so the export never needed them, and one of them can take over an
hour: in three `Stress test (amd_tsan)` runs a variant like
`SELECT * FROM merge(REGEXP('(?i)SYSTEM'), 'metric_log')` spent 64-72 min
building the plan for the `system.metric_log` child, since
`max_execution_time` is only checked between `Merge` children. On PR ClickHouse#114734
(60 min stress phase) that pushed the job past its 3 h timeout and no result
was uploaded.

Pass `--ast_fuzzer_runs 0`, as `stress.py` and `setup_log_cluster.sh` already
do for harness statements. The stress run itself keeps the fuzzer.

Validated with the stress profile over a populated server data directory:
the function ran 20 fuzzed queries on master and 0 with this change, with
identical exported files; `--ast_fuzzer_runs 5` brings them back.

Related: ClickHouse#114734 (comment)

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

clickhouse-gh Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e54b2de]

Summary: ✅


AI Review

Summary

The PR disables inherited AST fuzzing during system-log export by passing --ast_fuzzer_runs 0 to clickhouse-local. The override reaches query execution in both callers without changing the stress-server profile. No actionable findings. The author reports 20 fuzzed queries before the change and zero afterward, with identical exports; I did not independently rerun that comparison.

Missing context / blind spots
  • ⚠️ The latest CI report says the full suite was skipped by the review-thread gate. A rerun of the stress and upgrade jobs would provide independent end-to-end confirmation beyond the documented local validation.
Final Verdict

Status: ✅ Approve

@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 1 finding; 2 runs on this head). My own cold review of the diff found nothing.

# Sev Finding Verdict Evidence / action
1 💡 The PR description gave the dates of the cited runs without a year (.claude/CLAUDE.md requires YYYY-MM-DD) AGREE, fixed in the description Now "on 2026-11-20 and 2026-11-21"; the re-run on the final description had 0 findings

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are
terminal per finding. Findings on hunks unchanged by the fix round are auto-dropped.

Session id: cron:clickhouse-review-slot-8:20261123-135714

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @nikitamikhaylov, could you review this? Stress job log export: run clickhouse-local with --ast_fuzzer_runs 0 so fuzzed variants of the export query cannot push the job past its 3 h timeout (seen on #114734)

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Nov 23, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, of the mechanism: with the stress profile, the master export command ran 5 fuzzed queries per table in every run (20 over the 4 tables). Which variant is slow is random and is not claimed.
b Root cause explained? --config-file loads the stress default profile (ast_fuzzer_runs = 5), so clickhouse-local runs up to 5 fuzzed variants of each export query before it exits; a merge() variant over the system logs planned for 64-72 min in 3 amd_tsan runs, which pushed a 60 min stress run past 3 h.
c Fix matches root cause? Yes: the export stops fuzzing (--ast_fuzzer_runs 0, the same pin stress.py and setup_log_cluster.sh use). No timeout or other guard.
d Test intent preserved / new tests added? Test-infrastructure change, so no test of it ships; validated locally against a populated data directory.
e Both directions demonstrated? Master function: 20 fuzzed queries; patched: 0; with --ast_fuzzer_runs 5 they come back. Exported files identical.
f Fix is general across code paths? This is the only stress/upgrade clickhouse-local call that loads the server config; the clickhouse_proc.py and export_coverage.py exports run with profiles that do not enable the fuzzer.
g Fix generalizes across inputs (params/datatypes/wrappers)? One flag covers all four exported tables, checked per table. No types involved.
h Backward compatible? (maintainer-approved exception only) Yes: harness only, output unchanged, both callers run a binary with the setting.
i Invariants and contracts preserved? The pipeline and its error handling are unchanged; fuzzed results were never written to the dumps.

Session id: cron:clickhouse-impl-slot-6:20261123-134504

Comment thread tests/docker_scripts/stress_tests.lib Resolved
@clickhouse-gh clickhouse-gh Bot added can be tested Allows running workflows for external contributors manual approve Manual approve required to run CI labels Nov 23, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Nov 23, 2026
@PedroTadim
PedroTadim added this pull request to the merge queue Nov 24, 2026
Merged via the queue into ClickHouse:master with commit 478291e Nov 24, 2026
578 of 580 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-testing Test content only (no production code). manual approve Manual approve required to run CI 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.

3 participants