Repository navigation
Fix log export on the AST fuzzer and stress jobs - #117996
Conversation
Two independent defects left the CI-logs export non-functional on the AST fuzzer, BuzzHouse and stress jobs. `clickhouse/fuzzer` does not carry `boto3`. Its `requirements.txt` has no entry, while praktika's SSM fetcher moved back to `boto3` in the 2026-07-13 sync (`633ec9e571ae8a4`, which touched 78 `ci/praktika/` files and 0 `ci/docker/` files). The config step therefore dies inside the container with `ModuleNotFoundError: No module named 'boto3'` and writes no server config. The three other images that run `log_export` all pin `boto3==1.38.28`; `clickhouse/fuzzer` is the fourth and the only one missing it. The credentials do not survive the two-process split. `run-fuzzer.sh` and `stress_runner.sh` invoke `clickhouse_proc.py logs_export_config` and `logs_export_start` as separate processes, because the config has to be written before the server starts and the tables created after it responds. The second process builds a fresh `ClickHouseProc`, whose constructor leaves `log_export_host` and `log_export_password` as `None`, and the `logs_export_start` branch fetched nothing. `log_export.start` exports the cluster environment only when a host is set, so `setup_log_cluster.sh` took its `No CI logs creds found` branch, every remote `CREATE` was skipped for want of connection arguments, and the step still exited 0. A green master stress job (run 33783507690) shows this half in isolation: its config step succeeded, there is no traceback anywhere, and it created zero `_sender` tables. Both call sites are wrapped in `|| echo`, which is why the first defect only ever produced a traceback and the second was completely silent. The credential fetch goes in the CLI dispatcher branch rather than in the shared `start_log_exports`, because the dispatcher is the only place the process boundary is crossed: a repo-wide grep for the three `logs_export_*` commands returns exactly four bash call sites, and every in-process caller constructs `ClickHouseProc` directly and already holds the credentials. `performance_tests.py` is the in-tree precedent for fetching in both phases. `clickhouse_proc.py` is also added to the three fuzzer job digests. It is the one member of the log-export chain that `7d3886aca306e0c` left out of them, and by the rule that commit's message states, a later edit to the file carrying this fix would otherwise be served from cache on the fuzzer legs.
`setup_log_cluster.sh` issues every local harness statement through
`clickhouse-client "${LOCAL_ARGS[@]}"`. On the AST fuzzer and BuzzHouse legs
`run-fuzzer.sh` installs `query-fuzzer-tweaks-users.xml`, which sets
`ast_fuzzer_runs` to 5 and `ast_fuzzer_any_query` to true on the `default`
profile, and `LOCAL_ARGS` passes no `--user`, so the harness client runs on that
profile. With `ast_fuzzer_any_query` the server fuzzes DDL as well as read-only
queries, and in `QueryFuzzer` a fuzzed `CREATE` is renamed unconditionally while
a materialized view's external `TO` target is preserved four times in five. A
`system.<table>_watcher__fuzz_N` clone that survives mutation therefore keeps
pushing rows into the real `system.<table>_sender` for the rest of the job, and
where its `AS SELECT` was itself mutated those rows are not even copies.
This only became reachable because of the rest of this change. While
`CLICKHOUSE_CI_LOGS_HOST` was unset the per-table loop skipped the remote
`CREATE` for want of connection arguments and so never ran the two local
statements at all.
Measured on a server carrying that profile, running the two local statements 25
times per arm. Unpinned, the server attempted 128 fuzzed `CREATE` mutants and one
draw left a persistent `system.query_log_watcher__fuzz_228` whose target is the
real `system.query_log_sender`. Pinned, 0 mutants and 0 clones. Flipping the same
invocation back to `--ast_fuzzer_runs 5` restored 139 mutants, so the zero is the
pin rather than a dead fixture. On a server without that profile the pinned and
unpinned results are byte identical, since the setting already defaults to 0.
The two `xargs` invocations in `stop_logs_replication` expand
`${LOG_EXPORT_SERVER_PORT:+...}` directly and cannot take the array, so they are
not covered. They are unreachable: nothing in the repository calls
`logs_export_stop`.
The read-only harness queries lose the incidental fuzzing they get today. That is
intended. Those mutants create no persistent object and pollute no data, so the
coverage was a side effect of the harness sharing a profile with the fuzzer, and
the harness is plumbing rather than a fuzz target.
Internal second-model review (click to expand)Two cold review rounds and two second-model gate runs before this was pushed; the second round ❌ Round 1 found one real defect in this PR's own contract. Making the export half of
💡 Two notes, no code change. That commit's message calls the two |
|
Workflow [PR], commit [a140e42] Summary: ✅
AI ReviewSummaryThis PR fixes several CI log-export plumbing gaps for the AST fuzzer and stress jobs: it adds Findings
Final VerdictChanges requested. LLVM Coverage ReportMeasured on commit a140e42.
Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage). Newly covered: +1137 lines in 272 files (-782 lines lost coverage) · Details |
|
cc @Felixoid @leshikus, could you review this? Log export was configured but never actually started on the AST fuzzer and stress legs: |
CI finish ledger - bb55056Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20260904-090000 |
…er-and-stress-jobs
|
🕵 Merged Both retry_errors=[
"Error response from daemon: manifest unknown: manifest unknown",
],to The amd leg is the other half you named: the build stalls on Neither is covered by the two open PRs in this area: #118023 makes the index fetch fatal in the On the change itself, I re-verified the three claims it rests on:
|
| # This command runs in a process of its own, so it holds none of the | ||
| # credentials `logs_export_config` fetched, and `setup_log_cluster.sh` | ||
| # creates no `_sender` table without them. | ||
| ch.log_export_host, ch.log_export_password = ( |
There was a problem hiding this comment.
Re-fetching the CI Logs SSM secret here means the fuzzer/stress fix still depends on a second remote lookup after logs_export_config has already succeeded. Because both shell call sites still do || echo, one transient boto3/SSM failure at start time silently disables log export again, and a secret rotation between the two steps can leave setup_log_cluster.sh talking to different credentials than the running server loaded into system_logs_export. Please reuse the values written by logs_export_config (or read them back from system_logs_export.yaml) instead of hitting SSM again here.
|
Both halves are owned by one fix already in progress in the praktika path, and I will post the link here when it opens. The sentinel half lands as you describe, generalized a little: rather than adding two strings to For the amd leg I measured |
`tests/config/install.sh` removes the whole `config.d` on every run to drop stale
drop-ins, which takes `system_logs_export.yaml` with it. The stress test installs
the configs twice: once before the first server start, and once more after the
datasets are loaded, right before the server is restarted for the stress run.
That was harmless while the stress leg created no `_sender` table. It creates them
now, and they are `Distributed` tables over that cluster, so on the restart
`StorageDistributed::initializeFromDisk` resolves the cluster for every non-empty
per-shard directory, the resolution fails, and the `system` database cannot be
loaded:
Application: Caught exception while loading metadata: Code: 722 ...
Load job 'load table system.zookeeper_log_sender' failed: Code: 701.
Requested cluster 'system_logs_export' not found
The server then aborts, and all ten `Stress test (*)` arms reported `Cannot start
clickhouse-server` after 7 start attempts. Nothing else in the stress scripts
touches that file, so the reinstall has to carry it.
Measured both directions with the pristine and the patched script over the same
config tree. The pristine one leaves `config.d` without the file and a server
holding a `_sender` table with one buffered async insert dies with the signature
above; the patched one keeps the file byte-identical and with its mode, and the
same server comes back up with the table and its buffered file intact. An
unrelated file placed in `config.d` is removed by both, so the clean-out is not
weakened.
`StorageDistributed` skips its cluster sanity check when a table is attached rather than created, so the presence of a `system.*_sender` table in the metadata is not on its own enough: `initializeFromDisk` reaches the cluster only for a per-shard directory that still holds a queued asynchronous insert, which is the state the `_watcher` views leave behind. Measured: a `_sender` table with an empty queue starts fine without the cluster, and the same table with one queued file does not.
|
The ten
The fifth hunk carries that one file across the reinstall. Measured both directions with the One caveat for reading the next run: the abort needs a non-empty sender queue, so a green stress arm |
|
Fixing PR for both Root cause, for the record: the failure was not in the This head is still unvalidated for the reason the ledger gives: the dropped nodes are the AST fuzzer |
…ness's own queries After a clean fuzz run (`Fuzzer exit code is 143`), the post-fuzz liveness probe `clickhouse-client --handshake_timeout_ms=30000 --receive_timeout=5 --query 'SELECT 1'` sometimes never returns. status.tsv is then never written, praktika kills the job at its 18000 s timeout before any artifact is uploaded, and the job reports a bare ERROR with no server log. Five such runs in 45 days: PR ClickHouse#112304 (2026-08-18), PR ClickHouse#98670 (2026-08-19), PR ClickHouse#115530 (2026-08-20), true master 9816d0a `AST fuzzer (amd_release, oracle)` (2026-09-24) and PR ClickHouse#119237 `AST fuzzer (amd_debug, targeted, old_compatibility)` (2026-09-25). Only the last one printed the `1`. Two harness defects make the probe unbounded. (a) The probe is itself fuzzed on the server. query-fuzzer-tweaks-users.xml sets ast_fuzzer_runs=5 and ast_fuzzer_any_query=true on the `default` profile, and no harness-owned client call opted out. The server runs the mutated copies in a query-finish callback, and TCPHandler calls io.onFinish() after sending the data and before EndOfStream, so a fuzzed follow-up that does not finish holds the reply open after the `1` was printed. The same pin was part of ClickHouse#113248, which was closed as already integrated, but its run-fuzzer.sh half never reached master. The stress harness (ClickHouse#114127), the log export (ClickHouse#117996) and tests/clickhouse-test already pin it. (b) --receive_timeout does not bound the probe either. On a receive timeout ClientBase::receiveResult only records TIMEOUT_EXCEEDED and cancels the query; from then on it polls the connection until the server sends a packet, with no bound. A server whose connection thread never gets back to the socket holds the probe forever, which is what the four runs that printed nothing show. Pin --ast_fuzzer_runs=0 on every harness-owned client call through one variable; the fuzzer's own client stays unpinned. Run the two post-fuzz probes (the restart liveness check and the probe loop) under `timeout --signal TERM --kill-after=10 60`. A probe killed by timeout (rc 124, or 137 after the kill) is counted like the client's own "Timeout exceeded while", so a server that stops answering reaches the existing "treating server as hung" verdict after 12 retries (about 14 minutes) and the job keeps its logs. 60 s covers the probe's own worst case (30 s handshake, 5 s receive timeout, the cancel round trip) with room for a slow sanitizer server. The fallback branch now prints the probe's exit code instead of the last grep's. The pre-fuzz probes are not wrapped: the check after attaching gdb waits for gdb to load debug info on purpose, and the server is fresh there. One server-side hang the fuzzer produces, a self-deadlock when one query builds two system.stack_trace sources, is fixed separately in ClickHouse#120216. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #110180 (comment)
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Improve log export on the AST fuzzer and stress jobs failures.
Description
AST fuzzer (amd_release, oracle)dies withModuleNotFoundError: No module named 'boto3'in itslogs_export_configstep(job). Two
defects, one of them silent.
clickhouse/fuzzerdoes not carryboto3. Praktika's SSM fetcher moved back toboto3in the2026-07-13 sync (
633ec9e571ae8a4, which touched noci/docker/file).stateless-testandperformance-comparison, the other images that runlog_export, use the same pin.The credentials do not survive the two-process split.
run-fuzzer.shandstress_runner.shrunthe config step and the start step as separate processes, so the start process builds a fresh
ClickHouseProcwithlog_export_hostunset,log_export.startskips itsif host:block, and thestep exits 0 printing
No CI logs creds found. A green master stress job (33783507690) showsthis half alone: zero
_sendertables.Both call sites are wrapped in
|| echo, so neither defect turns a job red; the reported job's red isan AST fuzzer oracle mismatch, tracked in #117188.
The third hunk adds
clickhouse_proc.pyto the three fuzzer job digests, the member7d3886aca306e0cmissed.Setting the host reaches the half
setup_log_cluster.shskips today: the remote destination tablesplus the local
_senderand_watcherobjects. The harness DDL runs on thedefaultprofile, wherequery-fuzzer-tweaks-users.xmlsetsast_fuzzer_runs=5, and a fuzzedCREATEis renamed while amaterialized view's
TOtarget survives, so a_watcher__fuzz_Nclone would keep feeding the real_sender: the fourth hunk pinsast_fuzzer_runs=0there (25 draws: 128 mutants and one cloneunpinned, 0 and 0 pinned). The read-only harness queries lose their incidental fuzzing; intended, the
harness is plumbing. And the stress test reinstalls the test configs before restarting the server,
which clears
config.dand with it the cluster definition, so restoring a_senderqueue abortsstartup with
Code: 701; all tenStress test (*)arms failed to start. The fifth hunk carries thatone file across the reinstall.
Workflow [PR]
Sync PR [sync-upstream/pr/117996]
Version info
26.9.1.805(included in26.9and later)