Repository navigation
Stabilize 03381_lazy_materialization_limit_offset under MSan + WasmEdge - #104162
Conversation
…ex_granularity Random settings limit only had an upper bound on `index_granularity` and no limits on `index_granularity_bytes`. With no lower bound, the test runner randomized `index_granularity` down to 27 (and `index_granularity_bytes` can be as low as 1024), producing 7400+ granules over the 200K-row table. The 300s client timeout fired while `ALTER TABLE test MODIFY COLUMN json JSON SETTINGS mutations_sync=1` rewrote all parts. Each granule contributes per-mark overhead that compounds with MSan + WasmEdge slowdown plus parallel CI contention. CIDB shows the same failure across 3 unrelated runs in 30 days (PR ClickHouse#100947, master 76e37f1, PR ClickHouse#100375), all in `Stateless tests (amd_msan, WasmEdge, parallel, 1/2)`, all with `index_granularity` in {27, 18, 28}. Locally measured (debug build, 200K rows, JSON `ALTER MODIFY`): - default `index_granularity=8192` 24 granules, 0.21s - failing `index_granularity=27` 7408 granules, 1.62s - pathological `index_granularity_bytes=1024` 7408 granules, 1.62s - proposed floor `index_granularity=100, bytes=10000` 2001 granules, 0.59s Mirrors the limits already used by the source test `03246_alter_from_string_to_json.gen.sql` from which 03381 was derived. Per @alexey-milovidov's request on ClickHouse#100375 (comment)...
Pre-PR validation gateSession: (a) Deterministic repro? Yes — local debug build, 200K rows, (b) Root cause explained? Yes — the test was derived from (c) Fix matches root cause? Yes — clamping (d) Test intent preserved? Yes — only the runner-side clamp comment changes. SQL, row count (200K), (e) Both directions demonstrated? Yes — without the fix, randomization hits (f) Fix is general, not narrow patch? Yes — this is a test-only |
|
cc @alexey-milovidov — could you review this? Per your request on #100375 (issue 4383496162). Test-only |
|
Workflow [PR], commit [d8374c5] Summary: ❌
AI ReviewSummaryThis PR updates Final Verdict
|
…lazy-materialization-granularity
Why
Test
03381_lazy_materialization_limit_offsethas been timing out (300s client timeout, return code 159) onStateless tests (amd_msan, WasmEdge, parallel, 1/2)runs across 3 unrelated builds in the last 30 days:index_granularity76e37f1972cdeb9c831dab35In all three runs the test runner's
--diagnose-random-settingsminimization pinpointed the MergeTree settings — and in all three runs the randomizedindex_granularityis in{18, 27, 28}. With 200K rows that produces ~7400 granules. Each granule contributes per-mark overhead inALTER TABLE test MODIFY COLUMN json JSON SETTINGS mutations_sync=1, which compounds with MSan + WasmEdge slowdown plus parallel CI contention.The test was originally derived from
03246_alter_from_string_to_json.gen.sql, which already pinsindex_granularity=(100, 60000); index_granularity_bytes=(10000, None). The derived test silently dropped both lower bounds, leaving the runner free to pickindex_granularityfrom[1, 65536]andindex_granularity_bytesfrom[1024, 30 MiB].What
Mirror the bounds used by the source test: clamp
index_granularityto[100, 60000]andindex_granularity_bytesto[10000, None]. No SQL changes — only theRandom settings limitscomment.Local validation (debug build, 200K rows)
index_granularityindex_granularity_bytesALTER MODIFYtimeThe 7.6× slowdown at granularity 27 in a fast debug build maps to the 300s timeout under MSan (10–20× slowdown) + WasmEdge + parallel CI load.
The runner-side clamp simulation (using
apply_random_settings_limitsfromtests/clickhouse-test) confirms all three failing combinations from CIDB are clamped up to safe values.CI report links
Sent as a separate PR per @alexey-milovidov's request on #100375 (comment).
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
Version info
26.5.1.771