Repository navigation
branch-4.1: [fix](be) Reject legacy Variant blocks before deserialization (#69434) - #70492
Merged
Merged
Conversation
…tion (apache#69434) cherry-pick apache#69434 (supersedes closed apache#69454)
Member
Author
|
run buildall |
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.
cherry-pick #69434
Supersedes #69454, which was opened for branch-4.1 and closed unmerged before #69434 merged.
Problem: during a mixed-version upgrade a 4.1 backend can receive a Variant V1 block from a 4.0
backend. The 4.0 block carries
variant_max_subcolumns_countbut novariant_enable_doc_modefield and no trailing doc-value map; the current 4.1 V1 deserializer reads that map
unconditionally, so it decodes past the payload and can crash the receiving backend.
Fix: pass the presence of
variant_enable_doc_modethrough the factory's Variant V1 branch andreject a V1 block at the deserialization entry when the field is absent. Presence is the format
marker: this branch sets the field even when doc mode is false and always writes the trailing map.
The V1/V2 wire layout and
be_exec_versionare unchanged.Validation:
./build.sh --be./run-be-ut.sh --run --filter=BlockVariantWireFormatTest.*: 4/4 passed (legacy marker absent,raw pre-doc payload, nested ARRAY/MAP/STRUCT, V1/V2 round trips)