Skip to content

BuzzHouse: do not enable pauseable failpoints, which park a fuzzer query for the rest of the run - #115554

Merged
PedroTadim merged 1 commit into
ClickHouse:masterfrom
groeneai:buzzhouse-exclude-pauseable-failpoints
Aug 20, 2026
Merged

PedroTadim merged 1 commit into
ClickHouse:masterfrom
groeneai:buzzhouse-exclude-pauseable-failpoints

Conversation

@groeneai

@groeneai groeneai commented Aug 20, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #104437
Related: #115264

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

Requested by @ bacek on #104437.

BuzzHouse (amd_msan) on #104437 (job, report) reported ERROR with Fuzzer runner aborted before writing status.tsv. The fuzz phase finished normally, then the job went silent for 71 minutes and died with the container.

Root cause: the fuzzer enabled the pauseable failpoint storage_merge_create_children_plans_pause (server.log:324783) and never disabled it - the log has 67 DISABLE FAILPOINT lines for other names, none for this one. 13 minutes later it issued SELECT elapsed, query FROM merge('system', '^processes$'), which parked at StorageMerge.cpp:923 and was that thread's last line. pauseFailPoint has no timeout and wakes only on a NOTIFY or DISABLE naming that same failpoint, so teardown never reached clickhouse stop and status.tsv was never written.

The selection query draws from all of system.fail_points, 84 rows of which are pauseable or pauseable_once, and each of the four failpoint statements picks its name independently at random, so the resume is unlikely to ever be generated. Filtering by type also covers failpoints added later, and follows 6e8e70e0384bf59, which excluded the thread-group injections here.

Deliberate coverage reduction: all four statements draw from this one list, so DISABLE, NOTIFY and WAIT of pauseable failpoints go too. @ PedroTadim, that collides with the intent stated in #115264 - please say if you would rather I solved it another way. enableFailPoint creates a wait channel only for the two pauseable types, so afterwards a fuzzer WAIT returns at once and a NOTIFY throws Cannot find channel, as it already does for the other 215 names.

Validated locally: 299 names (84 pauseable) become 215 with none pauseable, once plus regular unchanged at 215; a BuzzHouse run loads 215 and still emits failpoint statements, none pauseable. 5 of the 140 stateless tests using failpoints gave identical results before and after. #115264's ORDER BY rand() LIMIT 10 composes with this clause.


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

Version info

  • Merged into: 26.8.1.1760 (included in 26.8 and later)

BuzzHouse's failpoint selection query drew from all of system.fail_points, 84 rows
of which are pauseable or pauseable_once. Those block the next thread to reach them
until a NOTIFY or DISABLE names that same failpoint, with no timeout, and each of the
four failpoint statements (enable, disable, notify, wait) picks its name independently
at random from that one list. So a resume for the specific paused failpoint is unlikely
to ever be generated, and the fuzzer's own query stays parked for the rest of the run.

BuzzHouse (amd_msan) on ClickHouse#104437 (654c183) hit exactly
that: the fuzzer enabled storage_merge_create_children_plans_pause and never disabled it
(the log has 67 DISABLE FAILPOINT lines for other names, none for this one), then parked
13 minutes later at StorageMerge.cpp:923. Teardown never reached "clickhouse stop", so
status.tsv was never written and the job reported ERROR with no useful signal.

Filter the selection by type rather than by name so failpoints added later are covered
too, following 6e8e70e which excluded the thread-group injections from the same
call. This bounds only the fuzzer's random selection: the failpoints' semantics and the
stateless tests that enable them deliberately are untouched.

Note that this also drops DISABLE, NOTIFY and WAIT of pauseable failpoints, since all
four statements draw from this one list. That is intended: a WAIT on a never-paused
channel can park the fuzzer's connection by itself.

Measured locally: the query goes from 299 names (84 pauseable, including the one above)
to 215 with none pauseable, while the once and regular count is unchanged at 215; a
BuzzHouse run loads 215 and still generates failpoint statements, none of them pauseable.

Co-Authored-By: Claude Fable 5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai labels Aug 20, 2026
@groeneai

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

Reviewed cold against the code on disk (carriers enumerated independently before reading the plan), then re-reviewed by a second model. 5 findings: 3 agreed and fixed here, 2 disagreed with evidence.

# Finding Verdict
⚠️ Excluding pauseable failpoints defeats the intent stated in #115264 ("limiting the number of failpoints per run, so the WAIT and NOTIFY failpoint can suceed more"). enableFailPoint creates a wait channel only for the two pauseable types (FailPoint.cpp:403-406), so afterwards waitForPause early-returns on the missing channel (:494-496) and notifyFailPoint throws Cannot find channel (:463). Agreed. Stated plainly in the description with the mechanism, and @ PedroTadim is asked directly whether he would prefer another solution.
💡 An earlier note claimed #115264 "merges cleanly". git merge-file returns rc=1 with 3 markers, all inside the comment block; the SQL string itself composes. Agreed. Narrowed to the claim that is true.
💡 The validation table said all 140 stateless tests using failpoints "keep working"; 5 were run. Agreed. Split into the construction argument and the measurement.
❌ pauseable, pauseable_once, NOTIFY and DISABLE in the new comment should be in backticks. Disagreed. CLAUDE.md asks for inline code on SQL-language names, classes, functions and log excerpts. In this same comment block all five leading failpoint-name lists are unbackticked, including the two added by 6e8e70e0384bf59, while every C++ and log literal in it is backticked. These are Enum8 values of a column, and the block already writes "neither reconnect nor disable it again" unbackticked. Backticking only the new line would leave it the sole inconsistent entry.
❌ One non-pauseable failpoint also blocks unboundedly and so survives a type filter: file_cache_stall_free_space_ratio_keeping_thread is regular, and its site is the only while (fiu_fail(...)) sleep_for(100ms) in src/ (FileCache.cpp:1655), inside a BackgroundSchedulePool task whose execute() and deactivate() share exec_mutex. Disagreed, out of scope. Its task exists only when a filesystem cache is initialised with a non-default keep-free-space ratio (FileCache.cpp:603-615), and run-fuzzer.sh installs no cache disk, so the site never runs in a fuzzer server and an enable is inert. Not observed in the failing run. Fixing it would mean going back to excluding by name, which is what this change replaces. Disclosed, not chased.

Root cause independently re-derived from the run's server.log (536811 lines): first ENABLE FAILPOINT storage_merge_create_children_plans_pause at line 324783 (06:21:10.517908), 67 DISABLE FAILPOINT lines over 7 other names and none for this one, and thread 475's last line in the whole file is the planner trace for the fuzzed SELECT elapsed, query FROM merge('system', '^processes$') at 06:34:25.635657. Name census reproduced from APPLY_FOR_FAILPOINTS directly: 307 entries, 0 duplicates, 84 pauseable, all 8 pre-existing name exclusions non-pauseable, so 299 becomes 215 with no name exclusion silently dropped.

Session id: cron:clickhouse-review-slot-8:20260820-005300

@clickhouse-gh clickhouse-gh Bot closed this Aug 20, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Aug 20, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. The unfixed selection query returns 84 pauseable failpoints, including storage_merge_create_children_plans_pause, on every run. Not a probabilistic repro.
b Root cause explained? Yes. pauseFailPoint waits with no timeout and wakes only on a NOTIFY/DISABLE naming that same failpoint, while each failpoint statement picks its name independently at random. So an enable without a matching resume parks the fuzzer's query for the rest of the run, and teardown never reaches clickhouse stop.
c Fix matches root cause? Yes. It removes the blocking class from the pool the fuzzer draws from. No timeout is added, failpoint semantics are unchanged, and the reporting path is untouched (it already reports ERROR correctly).
d Test intent preserved / new tests added? Preserved; no new test, deliberately. There is no deterministic SQL-level oracle for "the fuzzer no longer picks a class of failpoint", and a test asserting the query string would be a tautology. No stateless test reads the fuzzer's selection query, so none is weakened by construction; 5 of the 140 that use failpoints were run and matched.
e Both directions demonstrated? Yes, on two Build-ID-distinct binaries with server identity asserted each run. Without: 299 names, 84 pauseable, BuzzHouse loads 299, and the unfixed client demonstrably emits pauseable failpoint statements (6 distinct observed). With: 215 names, 0 pauseable, BuzzHouse loads 215, 45 emitted statements and none pauseable.
f Fix is general across code paths? Yes. fc.failpoints is populated in exactly one place and is the only source of names for all four statements (enable, disable, notify, wait), so one change covers them all. The sibling carrier, the AST fuzzer, is proven unreachable for this defect rather than merely unchecked: its rotation keeps fail_point_name, and no .sql corpus file names this failpoint (control: the .sh test that does is never fed to the fuzzer).
g Fix generalizes across inputs (params/datatypes/wrappers)? Yes, and by type rather than by name, so it covers all 84 current pauseable failpoints and any added later. Boundary case: an empty list would silently disable failpoint fuzzing altogether, so the once/regular count was measured before and after and is unchanged at 215. Composition with ORDER BY rand() LIMIT 10 from #115264 was also checked.
h Backward compatible? (maintainer-approved exception only) N/A, and verified rather than assumed: no setting, no serialization change, no user-visible server behaviour. This is one SQL string in the BuzzHouse client generator, compiled only under ENABLE_BUZZHOUSE. No SettingsChangesHistory.cpp entry is required.
i Invariants and contracts preserved? Yes. The loadServerSettings<String> contract is unchanged; the list stays non-empty so the !empty() guards on the statement generators behave as before; failpoint blocking semantics and the tests that depend on them are untouched.

Session id: cron:clickhouse-impl-slot-7:20260819-215600

@clickhouse-gh

clickhouse-gh Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [c21ed2f]

Summary: ❌

job_name test_name status info comment
AST fuzzer (amd_msan) FAIL
Logical error: Not-ready Set is passed as the second argument for function 'A (STID: 0250-41a5) FAIL cidb, issue

AI Review

Summary

This PR narrows BuzzHouse's random failpoint pool so it no longer selects pauseable / pauseable_once entries from system.fail_points, which matches the hang mechanism described in the PR: the generator reuses one shared name pool for ENABLE, DISABLE, WAIT, and NOTIFY, so a randomly enabled pauseable failpoint can otherwise park a thread indefinitely while the matching resume name is never chosen. I did not find a remaining correctness or safety issue in the changed path.

Final Verdict

Status: ✅ Approve

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @PedroTadim @mstetsyuk, could you review this? BuzzHouse drew failpoint names from all of system.fail_points, so it could enable a pauseable failpoint whose resume needs a NOTIFY or DISABLE naming that same name; since each statement picks its name independently at random the resume is rarely generated, the fuzzer parks its own query with no timeout, and teardown never writes status.tsv. This filters the selection by type. @PedroTadim, it also drops WAIT and NOTIFY of pauseable failpoints, which collides with the intent in #115264, so please say if you would rather I solved it differently.

@PedroTadim PedroTadim self-assigned this Aug 20, 2026
@PedroTadim
PedroTadim enabled auto-merge August 20, 2026 06:45
@clickhouse-gh

clickhouse-gh Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing c21ed2f01 with master 90a20ccf8 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 703.89 MiB 700.85 MiB -3.04 MiB (-0.43%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline.

Job report

@PedroTadim
PedroTadim added this pull request to the merge queue Aug 20, 2026
Merged via the queue into ClickHouse:master with commit 9965d6a Aug 20, 2026
352 of 358 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 20, 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 groeneai-origin-request PR origin: a maintainer pinged or directed groeneai 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