Repository navigation
Apply the memory limit of the external DISTINCT tests only to the queries under test - #123286
Conversation
…ries under test 05241_external_distinct_coalescing set max_memory_usage = 128 MiB for the whole session, so the limit also applied to the final system.query_log check. With the randomized use_uncompressed_cache = 1, that check is charged for every block it decompresses into the uncompressed cache (CachedCompressedReadBuffer::nextImpl allocates the cache cell under the query's memory tracker), and in a parallel run the granules around the four matching rows hold the ProfileEvents of many other tests. The check then failed with MEMORY_LIMIT_EXCEEDED while the queries under test were fine (Stateless tests (amd_debug, parallel) on ClickHouse#118757). Move the limit into the SETTINGS of the four queries under test, so the check runs with the job's normal limits. 05242_external_distinct_limit_remerge has the same construction (512 MiB) and gets the same change. The queries under test keep the same limit; the references are unchanged. 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; 1 finding) plus my own review (1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261001-142500 |
|
Workflow [PR], commit [18c25ed] Summary: ✅ AI ReviewSummaryThis PR narrows Final Verdict
|
CI finish ledger - 18c25edEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
146 of 146 check runs completed and Session id: cron:our-pr-ci-monitor:20261001-190203 |
47422e4
Related: #118757
Related: #121772
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
05241_external_distinct_coalescingfailed inStateless tests (amd_debug, parallel)on #118757 (reported there). The four queries under test returned the expected rows; the finalsystem.query_logcheck failed withQuery memory limit exceeded: would use 128.03 MiB ... maximum: 128.00 MiB: (while reading column ProfileEvents.key_ExternalDistinctWritePart).Cause. The test's
SET max_memory_usage = 134217728is session-wide, so it also caps that check. With the randomizeduse_uncompressed_cache = 1, the check is charged for every block it decompresses into the uncompressed cache (CachedCompressedReadBuffer::nextImpl). In a parallel run the granules around the four matching rows hold theProfileEventsof many other tests, so the charge depends on the whole run, not on this test.Change. Move the limit into the
SETTINGSof the four queries under test, so the check runs with the job's normal limits.05242_external_distinct_limit_remergehas the same construction (512 MiB) and gets the same change. The queries under test keep their limit, and the references are unchanged.Validation. On a copy of
query_logmade of this test's rows (303 MiB ofProfileEvents), the check with the old settings fails withCode: 2413/3 with the cache on (13.66 MiB peak with it off), and passes 3/3 with the new ones (338.8 MiB peak). 50 randomized runs of each test pass;query_logshows the 400 queries under test with their limit and with spilling and merging, and the 100 checks without it.Workflow [PR]
Sync PR [sync-upstream/pr/123286]
Version info
26.10.1.1600-master(included in26.10and later)