Repository navigation
Fix errors during building report (due to lack of space for temporary data) - #109397
Conversation
|
cc @azat for review: this disables temp-disk spilling on the report-build |
|
Workflow [PR], commit [9bd7cda] Summary: ✅
AI ReviewSummaryThis PR fixes the report-building Missing context / blind spots
Tests
Final Verdict
|
5638975 to
06c525a
Compare
|
Confirmed, and fixed in 06c525a. The distinction is exactly right: Verified empirically (26.7.1 debug local): Fix: split the report-build settings into query settings (passed before |
06c525a to
066f644
Compare
|
@azat done. Trimmed the code comments in both |
|
@groeneai description is still contains lots of words I think, just tell that "it tries to use external aggregation and the disk does not have enough space, let's instead limit memory and disable external aggregatoin" |
066f644 to
78cbf6b
Compare
|
Done in |
78cbf6b to
9011a6e
Compare
|
Updated (head The previous head's cap was wrong. The heaviest Since the |
There was a problem hiding this comment.
Code: 241. DB::Exception: Query memory limit exceeded: would use 16.06 GiB (attempt to allocate chunk of 64.00 MiB), maximum: 16.00 GiB: While executing MergeSortingTransform. (MEMORY_LIMIT_EXCEEDED)
Code: 241. DB::Exception: Query memory limit exceeded: would use 16.02 GiB (attempt to allocate chunk of 32.00 MiB), maximum: 16.00 GiB: While executing MergeSortingTransform. (MEMORY_LIMIT_EXCEEDED)
Code: 241. DB::Exception: Query memory limit exceeded: would use 16.01 GiB (attempt to allocate chunk of 12.00 MiB), maximum: 16.00 GiB: While executing JoiningTransform. (MEMORY_LIMIT_EXCEEDED)
Code: 241. DB::Exception: Query memory limit exceeded: would use 16.01 GiB (attempt to allocate chunk of 12.00 MiB), maximum: 16.00 GiB: While executing JoiningTransform. (MEMORY_LIMIT_EXCEEDED)
Code: 241. DB::Exception: Query memory limit exceeded: would use 16.01 GiB (attempt to allocate chunk of 12.00 MiB), maximum: 16.00 GiB: While executing JoiningTransform. (MEMORY_LIMIT_EXCEEDED)
Code: 241. DB::Exception: Query memory limit exceeded: would use 16.04 GiB (attempt to allocate chunk of 64.00 MiB), maximum: 16.00 GiB: While executing MergeSortingTransform. (MEMORY_LIMIT_EXCEEDED)
Code: 241. DB::Exception: Query memory limit exceeded: would use 16.05 GiB (attempt to allocate chunk of 64.00 MiB), maximum: 16.00 GiB: While executing MergeSortingTransform. (MEMORY_LIMIT_EXCEEDED)
Let's do one of two:
- decrease amount of parallelism
use tmp folder with a bigger fs- this will not work, we don't have such
|
Also PR title should not tell "what I did" but "what I fixed", so "Perf comparison: keep report-build clickhouse-local in RAM to avoid Code 243" is bad, "Fix errors during building report (due to lack of space for temporary data)" better |
|
Also for to simplify things for yourself, expose those errors to the log, so that you will not need to download big archive with all the data |
9011a6e to
e109885
Compare
|
Done in e109885:
Squashed to one commit; only the two files changed. |
| parallel -v --joblog analyze/parallel-log.txt --memsuspend 15G --null < analyze/commands.txt 2>> analyze/errors.log | ||
| # | ||
| # With external aggregation disabled, a single heavy job stays in RAM and can | ||
| # peak ~30G, so bound concurrency by host RAM to avoid Code 241. |
There was a problem hiding this comment.
| # peak ~30G, so bound concurrency by host RAM to avoid Code 241. | |
| # peak ~30G, so bound concurrency by host RAM to avoid Code 241. |
Please, don't use magic numbers, not 241, but MEMORY_LIMIT_EXCEEDED
There was a problem hiding this comment.
And also why do we need this, why "--memsuspend" does not helps?
e109885 to
6913803
Compare
|
Done in 6913803.
|
This is 95% wrong (and even the comment above says this), please do not give far fetched results, it takes way more time to validate you, then fix on my own. |
| # | ||
| # With external aggregation disabled, a single heavy job stays in RAM and can | ||
| # peak ~30G, so bound concurrency by host RAM to avoid MEMORY_LIMIT_EXCEEDED. | ||
| report_jobs=$(( $(awk '/MemTotal/ {print int($2/1024/1024)}' /proc/meminfo) / 30 )) |
There was a problem hiding this comment.
Use "/15" not "/30", after it it will suspend some jobs anyway, and it is already 4x reduction of parallelism (now it is 16, and will be 4)
There was a problem hiding this comment.
Ideally we need also some reserve, but this will decrease parallelism, which we do not want, so this is OK
… data) The report-building clickhouse-local tries to use external aggregation and the disk does not have enough space (NOT_ENOUGH_SPACE), so limit memory and disable external aggregation. Query settings must be passed before -- (settings after -- are treated as server/config overrides and silently ignored). With external aggregation off a single heavy job stays in RAM (~30G peak), so bound parallel concurrency by host RAM (host_ram/15) to avoid MEMORY_LIMIT_EXCEEDED; --memsuspend cannot reclaim RAM from already-running jobs. Also expose report/errors.log to the job log for easier diagnosis.
6913803 to
9bd7cda
Compare
|
Changed the divisor from host_ram/30 to host_ram/15, so on the 64 GiB host it is now |
|
You are right, I was wrong. `--memsuspend` does suspend already-running jobs: when free memory drops below 2*size it SIGTSTPs running jobs (down to a single running job below size), then resumes them as memory frees. It is not limited to not-yet-started jobs. The explicit `-j` cap just puts a deterministic ceiling on concurrency; `--memsuspend` does the memory-pressure smoothing on top of that. Sorry for the noise and thanks for validating. |
…rt-disable-tmp-spill Fix errors during building report (due to lack of space for temporary data)
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Related: #108804
The report build tries to use external aggregation and the disk does not have enough space (Code: 243), so limit memory and disable external aggregation. With spilling off a single job can peak ~30G, so also bound the parallel report jobs by host RAM to avoid Code: 241, and print
report/errors.logto the job log.CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109299&sha=34a2cd5d2faf6037651d0a9f6310ba967755e1a8&name_0=PR&name_1=Performance%20Comparison%20%28arm_release%2C%20master_head%2C%204%2F6%29
Version info
26.7.1.715(included in26.7and later)