Repository navigation
Cherry pick #115487 to 26.3: Do not push a bucket while any input is still at it in GroupingAggregatedTransform - #115779
Closed
robot-ch-test-poll2 wants to merge 7 commits into
Closed
robot-ch-test-poll2 wants to merge 7 commits into
robot-ch-test-poll2 wants to merge 7 commits into
Conversation
`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
…-memory-efficient-merging Do not push a bucket while any input is still at it in `GroupingAggregatedTransform`
Contributor
Author
Contributor
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.
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