Repository navigation
Run the user-limit case of the external DISTINCT ratio test at 4 GiB to fit the ASan query timeout - #122494
Conversation
test_max_bytes_ratio_before_external_distinct[user] fails on Integration tests (amd_asan_ubsan, db disk, 1/8) at the integration harness's 600 second per-query cap (DEFAULT_QUERY_TIMEOUT in helpers/client.py, applied unconditionally): since ClickHouse#121454 merged, 10 of 1972 runs on that job failed with "timed out after 600 seconds" at the ratio = 0.3 spilling call, one of them on master, and the passing runs have a median of 587 s. The test proves a memory-limit behaviour by consuming memory up to the limit, so the limit sets its runtime. At node_user's 10Gi profile limit the rejection half needs an unspilled footprint above 10 GiB, i.e. 100M ~85-byte keys, and on the ASan build the spilling half alone takes 412 s locally. ClickHouse#121096 had moved both parameters to 4Gi instances with 7M keys of 800 bytes; ClickHouse#121454 then skipped [server] under ASan, measured on that tree, and kept [user] because a user limit counts tracked bytes, not RSS; ClickHouse#121477 reverted ClickHouse#121096 in full on the strength of [server] failures (its query filters distinct[server]), which put [user] back on the workload that times out. This gives the [user] row its own query, the 7M x 800-byte workload with max_memory_usage_for_user = '4Gi' in its SETTINGS, on the existing node_user, so no instance is added. A user's memory tracker is reset when the user's last running query finishes (ProcessList), and the next query applies its own limit, so the 4 GiB holds after the group_by and sort tests' 10Gi queries on the same node. [server] keeps its query, node and ASan skip; only its query moved into the parametrize row. The trimmed [user] row passed all 152 runs of the failing job that carried ClickHouse#121096 (median 76 s). max_block_size is pinned to its default because the final merge holds one block of every spilled run at once, and a random draw above ~83.9K rows makes each 800-byte-key block a 128 MiB allocation. Measured on the ASan build (query_log.memory_usage of the spilling query, pin removed, draw forced): 84000 -> 3.45 GiB, 92237 -> 3.61 GiB, 96000 -> 3.33 GiB of the 4 GiB limit, and 88000 rejects the spilling query itself. The peak is not monotone in the draw (100000 -> 2.73 GiB, 50000 -> 2.04 GiB), because the size of the unspilled tail depends on how the input chunks align with the run size. Pinned, it is 2.57 GiB with 58 runs and 14 tail chunks at every draw. 04493_external_distinct and its siblings pin the same value. Measured locally, ASan+UBSan, db disk flavour, harness containers (cpus: 5, mem_limit: 12g): the spilling query drops from 411.6 s to 43.5 s; with the client cap scaled to 200 s the old test times out and the new one passes; the unspilled peak is 5.69 GiB, so the ratio = 0 half is still rejected, by "User memory limit exceeded ... maximum: 4.00 GiB"; 50 of 50 repetitions and the whole module twice passed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 2 findings).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20260927-011400 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-40:20260927-000500 |
|
Workflow [PR], commit [41cdda1] Summary: ✅ AI ReviewSummaryThis PR narrows the Final Verdict✅ No findings. |
Resolve the conflict in test_max_bytes_ratio_before_external_order_group_by_for_server/test.py. 26.9 has neither ClickHouse#120751 (the `sanitizer_build` dict) nor ClickHouse#121454 (the `limit_follows_rss` parameter and the ASan skip of the `[server]` case), so only the change of ClickHouse#122494 itself is ported: each case's query moves into its parametrize row, and the `[user]` row runs the 7M x 800-byte query with `max_memory_usage_for_user = '4Gi'`. The 26.9 sanitizer checks and the `[server]` query are kept as they are. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cherry pick #122494 to 26.9: Run the user-limit case of the external `DISTINCT` ratio test at 4 GiB to fit the ASan query timeout
…STINCT` ratio test at 4 GiB to fit the ASan query timeout
Backport #122494 to 26.9: Run the user-limit case of the external `DISTINCT` ratio test at 4 GiB to fit the ASan query timeout
…STINCT` ratio test at 4 GiB to fit the ASan query timeout
Related: #118637
Related: #121477
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Sized the user-limit case of
test_max_bytes_ratio_before_external_distinctto fit the integration harness's 600 second per-query timeout on Address Sanitizer builds.Description
test_max_bytes_ratio_before_external_distinct[user]times out onIntegration tests (amd_asan_ubsan, db disk, 1/8): https://github.com/ClickHouse/ClickHouse/actions/runs/35801986381/job/107020660441, and on master https://github.com/ClickHouse/ClickHouse/actions/runs/35994108559/job/107628302473. Since #121454 merged it has failed 10 of 1974 runs on that job, every time at the harness's unconditional 600 second client cap on the spillingratio = 0.3query; the passing runs have a median of 587 s.The test must consume memory up to the limit it checks, so the limit sets its runtime: at the 10Gi profile it needs 100M keys. This change gives the
[user]row its own query, 7M keys of 800 bytes withmax_memory_usage_for_user = '4Gi'in its settings, on the same node. A user's memory tracker is reset when its last running query finishes, so the lower limit applies after the other tests.[server]is unchanged.This re-lands only the
[user]half of #121096, which #121477 reverted: the failures behind that revert were in[server], whose limit is checked against RSS and which #121454 now skips on ASan. A user limit counts tracked bytes only, and this row passed all 152 runs of the failing job that carried #121096 (median 76 s). The alternative, skipping[user]on ASan too, leaves this test with no ASan coverage.max_block_sizeis pinned to its default, as the feature's own tests do (04493_external_distinct), because the final merge holds a block of every spilled run at once. The harness randomizes it between 8000 and 100000 in half of the runs; at 84000, 92237 and 96000 the spilling query peaks at 3.3 to 3.6 GiB of the 4 GiB limit, and at 88000 it fails. Pinned, it peaks at 2.57 GiB whatever the draw.Locally, on the ASan build, the spilling query drops from 412 s to 44 s; 50 of 50 repetitions and the whole module, in its usual order, passed.
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/122494]
Version info
26.10.1.848-master(included in26.10and later)