Repository navigation
Stabilize storage memory profiler many-parts scenario - #119706
Merged
qoega merged 1 commit intoSep 13, 2026
Merged
Conversation
Prevent background merge selection allocations from crossing the heap profile checkpoint. CI report: https://s3.amazonaws.com/clickhouse-test-reports/PRs/119480/5d231d28a46818502ba21e1aea90437e3c99586e/pr/storage_memory_check/storage_memory_report.html
Contributor
|
Workflow [PR], commit [d634e66] Summary: ✅ AI ReviewSummaryStops background merge selection for the storage-memory profiler's Final VerdictStatus: ✅ Approve |
aparajita31pandey
pushed a commit
to aparajita31pandey/ClickHouse
that referenced
this pull request
Sep 27, 2026
…scenario Every MergeTree table's BackgroundJobsAssignee keeps running StorageMergeTree::scheduleDataProcessingJob on the schedule pool, and a pass with nothing to merge still builds a merge predicate, a parts collector and ranges (~1.3 KB in the release profiler binary) that it frees on return. The storage profiler dumps the heap as soon as a scenario file returns, so a pass running at that dump on one arm is charged to that scenario and credited back at the next one: a conserved adjacent pair. `06_dictionary.sql` has an 80 KB baseline, so one pass clears both the 1,024-byte and the 1 % bar. Production reports on trees that already contain ClickHouse#120487 and ClickHouse#121364: ClickHouse#122127 `06` +1,296 and ClickHouse#120444 `06` +1,184, each exactly the rows of one selection pass, with `07` the same rows negated. Stop merges on each scenario table once nothing merges or mutates it any more, as ClickHouse#119706 did for `test_many_parts`: on `test_mt` after its last mutation at the end of `04`, and on `test_mt_2` / `test_mt_3` right after their CREATE in `05`. With the blocker set, scheduleDataProcessingJob returns before selectPartsToMerge. After `mutations_sync = 2` returns, the mutation task is in NEED_FINISH, which has no cancellation check, so the STOP in `04` aborts nothing. Both arms of a run read this checkout's scenario files, so the change is symmetric from the first run. `test_mt` stays exposed in `01`..`03`, where it must merge and mutate. Validated locally with one Debug build (no C++ in the diff): a clickhouse local probe of `01`..`05` counts 26-30 selection ranges in a 6 s idle window without the change, 0 with it, and 9-10 with any one STOP removed; with a 1,000-partition probe table, profiler dumps catch a selection pass in flight in 10 of 20 dumps without its STOP and 0 of 20 with it; a real +64 KiB allocation in `06` still FAILs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stops background merge selection in the storage memory profiler's many-parts scenario before inserting the parts. This prevents temporary background allocations from crossing heap-profile checkpoints and producing equal and opposite false differences in adjacent scenarios.
Related: #119480
CI report: https://s3.amazonaws.com/clickhouse-test-reports/PRs/119480/5d231d28a46818502ba21e1aea90437e3c99586e/pr/storage_memory_check/storage_memory_report.html
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Prevent spurious storage memory profiler differences caused by background merge selection.
Workflow [PR]
Sync PR [sync-upstream/pr/119706]
Version info
26.9.1.1385(included in26.9and later)