Skip to content

branch-4.1: [fix](be) Reject legacy Variant blocks before deserialization (#69434) - #70492

Merged
eldenmoon merged 1 commit into
apache:branch-4.1from
eldenmoon:branch-variant-41-guard
Nov 12, 2026
Merged

eldenmoon merged 1 commit into
apache:branch-4.1from
eldenmoon:branch-variant-41-guard

Conversation

@eldenmoon

Copy link
Copy Markdown
Member

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_count but no variant_enable_doc_mode
field 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_mode through the factory's Variant V1 branch and
reject 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_version are unchanged.

Validation:

  • ASAN ./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)

@eldenmoon
eldenmoon requested a review from yiguolei as a code owner November 12, 2026 02:46
@eldenmoon

Copy link
Copy Markdown
Member Author

run buildall

@eldenmoon
eldenmoon merged commit df8ed67 into apache:branch-4.1 Nov 12, 2026
18 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant