Repository navigation
Apply -WithMemoryTracking containers to src/Processors/Merges - #124917
Conversation
Replace the `std::` containers of the merge algorithms with their `-WithMemoryTracking` counterparts and add `src/Processors/Merges` to the style check. These containers hold merge state that scales with the inputs: the per-source `Sources` and row-reference chunk pool, the deferred-source and prefetch lists, the queued row sources of the collapsing algorithms, the chunks a replacing merge holds back for skipping `FINAL`, and the per-bucket chunks an aggregating merge accumulates. Three containers outside the directory are converted, because an algorithm in this directory is what fills them: - `ChunksToMerge::chunks` and the `GroupingAggregatedTransform` members that feed it. The type has two producers, `FinishAggregatingInOrderAlgorithm` here and the transform there, so it cannot be converted on one side only without a copy. The generic `Chunks` alias stays as it is; what is tracked is the per-bucket accumulation, which can hold a whole bucket's worth of aggregation state. - The `flattened_ancestors` out-parameter of `Nested::flattenTupleRecursive`. The tuple-flattening summing merge is its only caller that passes one. `Graphite.cpp` keeps its `ruleTypeMap` as `std::unordered_map`: it is a process-wide constant built during static initialization, so a throwing tracked allocator would charge it to whichever thread's memory tracker is current and could throw before any tracker exists. The local `using Row = std::vector<Field>` in `SummingSortedAlgorithm.cpp` is removed rather than converted - it redeclares `DB::Row` from `Core/Field.h`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DFFRj3kqWUsA1C3A8DapeT
|
Workflow [PR], commit [2042a65] Summary: ✅
AI ReviewSummaryThis PR mechanically replaces merge-algorithm Missing context / blind spots
Findings
Final Verdict
|
The exemption gave the wrong reason. `ruleTypeMap` is filled by its initializer during static initialization, when there is no thread status: both `std::unordered_map` and `UnorderedMapWithMemoryTracking` then charge `total_memory_tracker` directly (or nothing, if it is not initialized yet), and nothing can throw because no limit is set yet. With no difference between the two, there is nothing to exempt. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DFFRj3kqWUsA1C3A8DapeT
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units338 translation units recompiled, 3179 s compile time in total, 338 of them have a recent master baseline. |
Changelog category (leave one):
Workflow [PR]
Sync PR [sync-upstream/pr/124917]
Version info
26.10.1.2131-master(included in26.10and later)