Repository navigation
Conversation
…rg::alter PR ClickHouse#106102 (merged 2026-06-05 17:43 UTC) refactored Iceberg::alter to declare last_version and compression_method outside an if/else that assigns them in both branches. Clang-tidy cppcoreguidelines-init-variables flags the bare declarations and Build (arm_tidy) is built with -warnings-as-errors, so the build fails for every PR whose CI ran on master after this commit. CIDB shows 30+ unrelated PRs hitting this in the last 2 days (e.g. ClickHouse#89360, ClickHouse#103540, ClickHouse#106120, ClickHouse#106386, ClickHouse#106404, ClickHouse#106522, ClickHouse#105102, ClickHouse#106590). Initialize both variables to safe defaults at declaration. They are unconditionally overwritten in both if and else branches before use, so behavior is unchanged. The new defaults are only relevant if a future code path skips both assignments, in which case last_version=0 and compression_method=CompressionMethod::None are sane no-op values (the same defaults the old structured-binding form would produce through default-construction of the destructured aggregate). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate
Session id: cron:clickhouse-ci-task-worker:20260605-222000 |
|
cc @scanhex12 — quick review please. Trivial 2-line fix for the cc @alesapin as Iceberg manager. |
|
Workflow [PR], commit [d72cac5] Summary: ❌
AI ReviewSummaryThis PR is a narrow Missing context / blind spots
Final VerdictStatus: ✅ Approve |
|
@groeneai, fix this logical error: |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 6/6 (100.00%) | Lost baseline coverage: none · Uncovered code |
CI ledger — covered SHA
|
| check_name / test_name | Classification | Disposition |
|---|---|---|
BuzzHouse (amd_msan) / Logical error: Mutation of \Memory` table produced incomplete output: A (STID: 2380-3043)` |
known-chronic | Pre-existing chronic master flaky, unrelated to this 2-line clang-tidy fix in Iceberg/Mutations.cpp. CIDB shows STID 2380-3043 hitting 30+ unrelated PRs + master (10 hits) over the last 30d. The actual bug is in StorageMemory::mutate (src/Storages/StorageMemory.cpp:317) emitting fewer rows than declared during APPLY PATCHES mutations — completely separate code path from this PR's diff. Tracked in dedicated task following @alexey-milovidov's 2026-06-06 02:01Z directive requesting a new PR bundling the STID 2380-3043 fix with this clang-tidy fix. |
All other CI checks pass (Finish Workflow + Mergeable Check both green). PR is already APPROVED by @ alexey-milovidov.
Session: cron:our-pr-ci-monitor:20260606-040000
|
Closing as superseded: the identical fix (initialize |
…ect (STID 2380-3043) Fixes `STID: 2380-3043` (`Logical error: Mutation of \`Memory\` table produced incomplete output: block 0 has 0 rows, expected N`), reported by `@alexey-milovidov` on ClickHouse#106615 and seen on master and 8+ unrelated PRs. Reproducer (master HEAD, deterministic; aborts the server in debug builds): CREATE TABLE t (id UInt64, value String) ENGINE = Memory; INSERT INTO t VALUES (1, 'a'), (2, 'b'); ALTER TABLE t (APPLY PATCHES); -- or: ALTER TABLE t MATERIALIZE STATISTICS ALL; -- or: ALTER TABLE t MATERIALIZE INDEX nonex; Root cause: `MutationsInterpreter` short-circuits `APPLY_PATCHES` and `APPLY_DELETED_MASK` in its prepare loop without adding a stage. For `MATERIALIZE_INDEX`, `MATERIALIZE_PROJECTION`, `MATERIALIZE_STATISTICS`, and `MATERIALIZE_TTL`, the prepare loop also adds no column dependencies when the target structure does not exist on the storage (`Memory` has no indices, projections, statistics or TTL). The resulting pipeline pulls one output block per input block but with zero rows in each. `StorageMemory::mutate` then walks the partial-column path and fails the per-block row-count invariant. Fix: filter at the storage entry point. `Memory` tables hold raw column blocks in RAM and have no on-storage analog of indices, projections, statistics, TTL, patch parts, or a `_row_exists` deletion mask. Mutation commands that target those structures are semantic no-ops on `Memory` and are removed from the command set before constructing the pipeline. If all commands are filtered out, `mutate` returns immediately. A real `UPDATE` / `DELETE` / `MATERIALIZE_COLUMN` mixed into the same `ALTER` still executes. This supersedes ClickHouse#105286, which filtered only `APPLY_PATCHES` and `APPLY_DELETED_MASK`; CIDB shows the same `LOGICAL_ERROR` reaching the same code path via `MATERIALIZE STATISTICS ALL`, `MATERIALIZE INDEX <name>`, and `MATERIALIZE PROJECTION <name>` shapes that the narrower fix did not cover. Regression test `04322_memory_mutate_no_op_commands_2380_3043` exercises every no-op shape (`APPLY PATCHES` parens form and bare form, `APPLY DELETED MASK`, `MATERIALIZE STATISTICS ALL`, `MATERIALIZE INDEX nonex`, `MATERIALIZE PROJECTION nonex`) plus a mixed `UPDATE ... APPLY PATCHES SETTINGS mutations_sync = 1` to prove that real updates still execute. The existing `01867_fix_storage_memory_mutation` and `04229_memory_mutation_timeout_break` tests still pass. Caused by: ClickHouse#103706 Co-Authored-By: Claude Opus 4.8 <[email protected]>
Caused by: #106102
PR #106102 (
scanhex12/fix_alter_catalog, merged 2026-06-05 17:43 UTC) refactoredIceberg::alterto declarelast_versionandcompression_methodoutside anif/elsethat assigns them in both branches. Clang-tidycppcoreguidelines-init-variablesflags the bare declarations andBuild (arm_tidy)is built with-warnings-as-errors, so the build fails for every PR whose CI ran on master after this commit.CIDB shows 30+ unrelated PRs hitting this in the last 2 days (sample of
Build (arm_tidy)failures in last 2d):The fix initializes both variables to safe defaults at declaration. They are unconditionally overwritten in both
ifandelsebranches before use, so behavior is unchanged. The new defaults are only relevant if a future code path skips both assignments, in which caselast_version=0andcompression_method=CompressionMethod::Noneare sane no-op values (the same values the old structured-binding form would produce through default-construction of the destructured aggregate).Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...