Repository navigation
Cherry pick #113742 to 26.5: Skip the custom-key parallel replicas read when the requested stage cannot absorb finalized data - #114633
Merged
robot-clickhouse-ci-2 merged 5 commits intoAug 14, 2026
Conversation
…annot absorb finalized data The custom-key parallel replicas branch of the planner replaces the plan of a table expression with a remote read at the fixed stage `WithMergeableStateAfterAggregationAndLimit`, ignoring the stage the plan was requested up to. A `Merge` table over a `Distributed` child plans all of its children up to `WithMergeableState` through an interpreter, so a MergeTree child's plan produced finalized (post-aggregation, post-LIMIT) data where the parent `ReadFromMerge` expected partial aggregation states: `CANNOT_CONVERT_TYPE` for `count`, and the exception `Chunk should have AggregatedChunkInfo/ChunkInfoWithAllocatedBytes in GroupingAggregatedTransform` when the finalized type structurally coincides with the state type. Allow the custom-key read only when the requested stage is `Complete` or `WithMergeableStateAfterAggregationAndLimit` itself. Found by the targeted AST fuzzer on #110972 (an unrelated PR): https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110972&sha=ac0a584ce316ace31f4dbc16b38e1262a2344751&name_0=PR&name_1=AST%20fuzzer%20%28amd_debug%2C%20targeted%2C%20old_compatibility%29 Closes: #113741 Co-Authored-By: Claude Fable 5 <[email protected]>
…-stage Skip the custom-key parallel replicas read when the requested stage cannot absorb finalized data
Resolve the single conflict in `src/Planner/PlannerJoinTree.cpp`. On 26.5 the `parallel_replicas_enabled_for_storage` and `allow_parallel_replicas_for_join_tree` lambdas differ from master, so git overlapped the whole block with the small hunk of #113742. Took the 26.5 side for the block and re-applied only the PR's own change: the `to_stage_supports_custom_key` gate (`Complete` or `WithMergeableStateAfterAggregationAndLimit`) on the custom-key parallel replicas `if`. Original pull-request: #113742
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 #113742
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