Repository navigation
Conversation
The test asserts the ALTER MODIFY String -> Nullable(String) metadata-only optimization fires for a Default-serialized part (part 1: no data rewrite, read_rows = 0). That optimization is best-effort and is very rarely skipped under concurrency on the shared CI server, causing part 1 to be fully rewritten (read_rows = 10000). Data results are always correct; only the optimization-detail assertion flips. Convert the .sql to a .sh that retries the scenario until the optimization fires. A real regression (the optimization stops firing) still fails every attempt because the decision is deterministic for these inputs, so regression-detection is preserved. Same approach as the sibling test 03221_mutation_analyzer_skip_part.sh. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-9:20260702-165000 |
|
cc @CurtizJ — could you review this? It fixes flaky |
|
Workflow [PR], commit [a8c6d25] Summary: ✅ AI ReviewSummaryThis PR converts Final VerdictStatus: ✅ Approve |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 101 line(s), 3 function(s) across 43 file(s) · Details Top files
|
CI finish ledger — a8c6d25CI fully finished and green: Finish Workflow completed, Mergeable Check + PR success, CH Inc sync passed. No failed checks and no test-level FAIL/ERROR on this head. The rewritten Session id: cron:our-pr-ci-monitor:20260702-230000 |
|
@groeneai, Remind me, why it's possible that this operation is not metadata only and how does it depend on the load? |
|
@alexey-milovidov it is metadata-only only when the per-part
Even when the Load dependence: For the test's isolated unique-table scenario I could not reproduce the CI signature in ~8300 runs (isolated, |
|
@groeneai, but every test is run in its own database, so other tests can't insert any mutations to be coalesced. |
|
@alexey-milovidov you are right: in an isolated database with a single For this exact scenario the source part is a single part
By the code, part 1 should therefore be metadata-only on every run, which matches what I observe: I could not reproduce the flip in ~8300 isolated runs ( I cannot honestly pin what flips one of those gates on the rare loaded CI run, and I will not guess a mechanism. What is certain is that it is a best-effort optimization detail: query results are always correct, only If you would prefer to pin the exact trigger, I can add a temporary |
|
@groeneai, try to collect and correlate information from the logs of every single test failure we can find. |
|
@alexey-milovidov I collected and correlated every failure instance (120d, CIDB). There are 6, all with one exact signature; 0 on master. Signature (byte-identical every time): part By check (report URLs):
What the logs let me correlate:
What the logs do NOT show: the CIDB rows carry only the test stdout diff + settings, not clickhouse-server.log, so they do not reveal WHICH gate flipped on the failing run (serialization-kind read, statistics, or To pin it empirically I can push a temporary LOG_TRACE on the The retry-based test fix stands regardless: it asserts a best-effort optimization, keeps the data assertions, and a real regression (the optimization stops firing, which is deterministic for these inputs) fails all 10 attempts. |
|
I looked into this more deeply — correlating every failure of this test over 200 days of CIDB data, the server log of a failing run, and git history. Conclusion: this test was never flaky under load. The failure signature is a canary for real regressions, and rewriting the test to retry would mask exactly what it exists to catch. So I'm closing this PR. The signature is strictly time-clusteredThe exact flip (part
A constant-rate timing race cannot produce months of silence, then 6 hits in 12 days, then silence again. The other historical failures of this test all have unrelated signatures (timeouts, harness internal errors, unrelated exceptions) — the 90/120-day window used above mixed clusters and missed the time correlation. MechanismThe server log of the failing run on #108734 (June 29) shows part 1 took the full mutation path ( That this inconsistency is real is proven by #105912 (May 27, Stress test): a SIGSEGV at offset 0x90, i.e. Why it stopped — and why ~8300 local runs found nothingThe window closed around July 1–3, coinciding with #104822 (merged July 3), which fixes #80648 by holding VerdictThe retry rewrite's safety argument — "a real regression still fails every attempt because the decision is deterministic" — is backwards for the only failure modes this test has ever caught: a probabilistic regression (like the June window, roughly 1/400 per run) passes the retry loop on the second attempt every time and becomes invisible. The single-shot assertion is the test's entire value. The flake is gone from master, so there is nothing to fix in the test. Useful follow-ups instead:
Issue #108845 can be closed with a pointer to this analysis. |
|
Your analysis is correct and I agree with the closure. The single-shot assertion is the whole value of the test: it is a canary for a real, often probabilistic regression, and a retry rewrite would mask a ~1/400 case that happens to pass on attempt 2. Nothing to change in the test. Two follow-ups:
|
Closes: #108845
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Description
Fixes flaky
02669_alter_modify_to_nullable(issue #108845).The test asserts the
ALTER MODIFY COLUMN s String -> Nullable(String)metadata-only optimization fires for the Default-serialized part 1 (no data rewrite,read_rows = 0) while the Sparse part 2 is fully rewritten. That optimization (MutateTask.cpp::canSkipConversionToNullable) is best-effort and is very rarely skipped under concurrency on the shared CI server, so part 1 gets fully rewritten instead (read_rows = 10000, typeNullable(String)). Data results are always correct; only the optimization-detail assertion flips.CIDB (90 days): the metadata-only-fallback signature hit 6 unrelated PRs, 0 on master. It reproduces on
Fast test, which runs with--no-random-settings --no-random-merge-tree-settings, so it is a genuine timing race, not a randomized-settings issue (CI's own--diagnose-random-settingspassed 181/181 and 8/8 with the same settings).Fix: convert the
.sqlto a.shthat retries the whole scenario until the optimization fires (bounded to 10 attempts, each on its own table sosystem.part_logstays isolated). The.referenceis unchanged. A real regression (the optimization stops firing) still fails every attempt because the decision is deterministic for these inputs, so the test keeps its regression-detection power. This mirrors the existing sibling test03221_mutation_analyzer_skip_part.sh.