Repository navigation
Cherry pick #115487 to 26.6: Do not push a bucket while any input is still at it in GroupingAggregatedTransform - #115781
Conversation
|
@copilot resolve the merge conflicts in this pull request |
|
@copilot resolve the merge conflicts in this pull request |
The merge conflicts have been resolved. The cherry-pick branch now applies the
Submodule pointers and |
The merge conflicts are already resolved (addressed in the previous session). The cherry-pick branch (
GitHub's |
`GroupingAggregatedTransform` pushes a delayed bucket as soon as no input reports it as delayed any more and every input has read it. Reading it is not enough: an input whose last chunk is of this bucket can send more chunks of the same bucket, the producer converts the aggregation variants of a bucket one by one. Those chunks arrive after the bucket is pushed, they are put into `chunks_map` again, and the bucket is merged and pushed a second time, which returns the keys of the bucket twice. The in order push next to it never had this: it pushes the buckets before `current_bucket`, and `current_bucket` only moves on when every input has read a bucket after it. Require the same here, every input has to be strictly past the bucket. `Bucket N is pushed twice` fires in the builds with the assertions, and the rows are silently duplicated in the release ones. Reproduced by `04605_pr_plan_based_count_distinct_serialized` in the stress and in the stateless runs with the distributed plan, where the merging of the plan based parallel replicas became memory efficient. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
A delayed bucket has to be pushed once even when no input ever reads a bucket after it, and a delayed bucket below the highest one still has to be pushed before the inputs finish. The driver of the test is shared by the cases now. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
Whatever the producers postpone and in whatever order their chunks arrive, every bucket has to be pushed exactly once and the transform has to finish. Being stricter about when a delayed bucket can be pushed may only postpone a push: the in order push and the drain of the finished inputs still take every bucket. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
An input which has finished cannot send more chunks of a bucket, so it does not have to be past the bucket for the bucket to be pushed. Taking it into account kept a bucket until the end of the query when a source ended right on it, although every input which can still send something had moved past it. An input port reports itself finished only when it has no data left on it, so nothing of the bucket is lost. Reported by review of #115264. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
`GroupingAggregatedTransform::prepare` takes the ports whose edge has changed, `ExecutingGraph::updateNode` collects them from the changed edges alone. The driver of the test reported every input on every call, so the transform saw a waiting port without data and dropped it from the waiting set, although the real executor stays in `NeedData` until that port really changes. The reproduction relied on that: it pushed the bucket in a state which does not happen in a pipeline. Report only the ports which were really given a chunk or finished. The reproduction is a producer which postponed buckets 6 and 7 and resolves them in order now, and never sends anything above 7, so `current_bucket` stays behind the bucket which is pushed. Reported by review of #115264. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
…ypick/26.6/115487 # Conflicts: # src/Processors/Transforms/MergingAggregatedMemoryEfficientTransform.h
`Aggregator::Params` on the 26.6 branch does not take `enable_packed_string_keys_` yet, drop the argument from the merge parameters of the test.
c89dacc to
8a73f2c
Compare
Original pull-request #115487
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job