Repository navigation
Cherry pick #131736 to 26.3: Reject serialized query plan steps without their inputs - #132265
Merged
robot-ch-test-poll2 merged 8 commits intoNov 17, 2026
Merged
Conversation
The number of children of a step in a serialized query plan comes from the stream, but the step deserializers read their input headers (`ctx.input_headers.front()` and similar) without checking it, so a plan with a step lacking its children made the server read out of bounds. Make `QueryPlanStepDeserialization::input_headers` a checked view that throws `INCORRECT_DATA` for a missing input, which covers all steps at once, and reject a `UnionStep` without inputs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`DeserializedInputHeaders` stores a reference, so the temporary `SharedHeaders{header}`
used to initialize the deserialization context in the gtest was destroyed right after the
initialization. This made `LimitByStepSerialization` fail in unit tests, with
`stack-use-after-scope` under ASan. Use a named vector, and delete the rvalue constructor
of `DeserializedInputHeaders` so other callers cannot get the same dangling reference.
Address review feedback.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A step may take fewer inputs than its node has children, e.g. `Extremes` with two children stores one input header, while optimizations iterate over the children and read the input header of each of them out of bounds. Check that the number of input headers of each deserialized step equals the number of its children. Also replace the `chassert` in `BlocksMarshallingStep::deserialize` with an `INCORRECT_DATA` exception: a childless step aborted debug and sanitizer servers. Extend the test with both cases. Address review feedback. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A sink such as `GatherSend` has no output header, so calling `getOutputHeader` on it while collecting the input headers of its parent raised a `LOGICAL_ERROR` exception. Throw `INCORRECT_DATA` instead, and extend the test with a sink beneath another step. Also mark the accessors of `DeserializedInputHeaders` `[[nodiscard]]` as required by `modernize-use-nodiscard`. Address review: #131736 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolved the test conflict by keeping the remote's `buildNode` helper and the new cases, and adding the `Extremes` over `GatherSend` case on top of it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…g-inputs Reject serialized query plan steps without their inputs
Resolve conflicts of the cherry-pick of #131736 onto 26.3: - `Serialization.cpp`: keep the input-count and sink-child checks; 26.3 has no `MAX_QUERY_PLAN_STEP_CHILDREN`, step versions, or the relaxed header check. - `UnionStep.cpp`: keep the empty-input check; 26.3's `UnionStep::deserialize` reads no flags. - `BlocksMarshallingStep.cpp`: keep the input-count check; 26.3 has no `contextAllowsBlocksMarshalling` here. - Drop `gtest_limit_by_step_serialization.cpp`, which does not exist on 26.3. - Adapt the test `05775_query_plan_step_missing_inputs`: 26.3 does not register `ReadNothing`, `GatherSend`, or `BlocksMarshalling` steps, so use `ReadFromTable` children and drop the cases with the missing steps. 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.
Original pull-request #131736
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.
Before you resolve anything
Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.
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