Skip to content

More fuzzing in CI - #104207

Merged
PedroTadim merged 40 commits into
masterfrom
fuzz-upt2
May 8, 2026
Merged

PedroTadim merged 40 commits into
masterfrom
fuzz-upt2

Conversation

@PedroTadim

@PedroTadim PedroTadim commented May 6, 2026 •

Copy link
Copy Markdown
Member

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

...

Documentation entry for user-facing changes

  • Add newest settings to BuzzHouse.

  • Update server configuration file by removing obsolete settings,

  • Add new ALTER statements for Iceberg tables.

  • System statements.

  • More swappable functions and aggregates in AST fuzzer.

  • Fuzz time related settings in BuzzHouse with enable_time_settings option sometimes in CI.

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.5.1.440

@clickhouse-gh

clickhouse-gh Bot commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [01e63f5]

Summary: ✅


AI Review

Summary

This PR expands BuzzHouse/query-fuzzer coverage (new Iceberg EXECUTE command generation, more SYSTEM commands, REGEXP_TREE + YAMLRegExpTree dictionary paths, and broader settings/function mutation). I found correctness issues that can make several new fuzz paths deterministically fail before reaching the intended code paths.

Findings
  • ❌ Blockers
    • [src/Client/BuzzHouse/Generator/StatementGenerator.cpp:2174-2178] remove_orphan_files(location=...) is populated from t.getTablePath(...) (table root/absolute path), but Iceberg remove_orphan_files requires location to be relative under the table root. This generates invalid commands and misses the intended execution path.
    • [src/Client/BuzzHouse/Generator/StatementGenerator.cpp:2624-2627] SYSTEM FLUSH OBJECT STORAGE QUEUE ... PATH is filled with table path, not a concrete object key. The command waits for a specific object path state transition, so this can stall/fail instead of exercising queue processing.
    • [src/Client/BuzzHouse/Generator/StatementGenerator.cpp:2528] SYSTEM WAIT BLOBS CLEANUP picks from all disks, but the interpreter only accepts object-storage disks. This creates deterministic BAD_ARGUMENTS failures on common configs.
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ⚠️ New fuzz branches currently include deterministic-invalid command generation, reducing effective rollout quality of the added coverage.
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions:
    1. Generate relative location values (or omit location) for remove_orphan_files.
    2. Generate concrete object keys for FLUSH OBJECT STORAGE QUEUE ... PATH.
    3. Restrict WAIT BLOBS CLEANUP target selection to object-storage disks.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label May 6, 2026
@PedroTadim
PedroTadim enabled auto-merge May 6, 2026 11:25
Comment thread src/Common/QueryFuzzer.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.10% 84.10% +0.00%
Functions 91.10% 91.10% +0.00%
Branches 76.60% 76.60% +0.00%

Changed lines: 0.00% (0/53) | lost baseline coverage: 150 line(s) · Uncovered code

Full report · Diff report

@PedroTadim
PedroTadim added this pull request to the merge queue May 8, 2026
Merged via the queue into master with commit 2339a1b May 8, 2026
165 checks passed
@PedroTadim
PedroTadim deleted the fuzz-upt2 branch May 8, 2026 12:35
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label May 8, 2026
pull Bot pushed a commit to Mu-L/ClickHouse that referenced this pull request May 8, 2026
…dst type

Issue: ClickHouse#104335
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104207&sha=5d28f866f2fcc95da659a2cf1e71750d60db1b6e&name_0=PR&name_1=Unit%20tests%20%28tsan%2C%20function_prop_fuzzer%29

`caseWithExpression` builds a constant `Array(then_supertype)` for the inner
`transform` call out of the THEN values only, where `then_supertype =
getLeastSupertype(then_types)` ignores the ELSE-branch type. `transform`'s own
return type is `getLeastSupertype(then_supertype, default_type)`, computed at
its build time inside `FunctionTransformOverloadResolver::buildImpl`, and it
uses that return type to cast `cache->to_column` and `cache->default_column`.

Meanwhile `caseWithExpression` calls into `transform` with `result_type`
computed by its own `getReturnTypeImpl`, namely
`getLeastSupertype([THENs..., default])`. Whenever `getLeastSupertype` of the
combined set is narrower than the chained `getLeastSupertype(then_supertype,
default)` -- as happens when the THENs and the ELSE land in different
`ColumnDecimal` storages -- the two computations disagree.

Concrete failure: THENs `(UInt16, Int8)` give a then-only supertype of `Int32`.
With ELSE `Decimal(9, 2)`, `getLeastSupertype(Int32, Decimal(9, 2))` is
`Decimal(12, 2)` (`Decimal64` storage), but
`getLeastSupertype(UInt16, Int8, Decimal(9, 2))` is `Decimal(9, 2)`
(`Decimal32` storage). So `cache->to_column` is a `ColumnDecimal<Decimal64>`
while `executeNumToNum` is dispatched with `T = ColumnDecimal<Decimal32>`
(matching `column_result`), and the
`assert_cast<const T *>(cache->to_column.get())` in `transform.cpp` fires a
`Bad cast` `LOGICAL_ERROR` and aborts in debug / sanitizer builds. This is
what `Unit tests (tsan, function_prop_fuzzer)` hit on PR ClickHouse#104207 and the
exact symptom @PedroTadim filed in ClickHouse#104335.

Fix: include `args.back().type` (the ELSE branch type) in the supertype
computation that produces `dst_supertype`, so the dst array we hand to
`transform` is wide enough that
`getLeastSupertype(dst_supertype, default_type)` collapses to our
`result_type`. The existing `tryGetLeastSupertype` / `can_use_transform`
guards already cover the case where no common supertype exists.

The new regression test exercises the minimised case, the original fuzzer
query, plus `Decimal(38, 4)` and `Float64` ELSE variants. It uses
`clickhouse-local` because the server-side analyzer constant-folds the
all-constant expression before reaching `transform`; `clickhouse-local`
preserves the same code path the unit-test fuzzer hit.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
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.

2 participants