eldenmoon opened a new pull request, #71029:
URL: https://github.com/apache/doris/pull/71029

   ### Background
   
   Group Commit async mode writes each batch to a WAL before the transaction
   commits; after a BE restart, or when the load fails, the BE replays that 
file by
   deserializing length-prefixed PBlocks. Variant columns have two block 
layouts:
   the legacy V1 layout starts with a subcolumn count, while the V2 layout 
starts
   with its own const/row header. A V1 WAL left over from a 4.1 upgrade is 
replayed
   by a master BE, whose Variant reader is V2.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: #69434 (added the V2-only WAL guard this covers)
   PR Type: Test
   
   Problem Summary:
   
   A V1 Variant block must be rejected before the V2 reader interprets its 
bytes as
   V2 lengths; the production failure was a SIGSEGV in
   WalReader::get_block -> Block::deserialize while replaying such a WAL. The
   existing block-level tests clear metadata on synthetic PBlocks, and the Group
   Commit Variant regression only inserted keys, so no test replayed a real
   cross-version WAL or checked the replayed values. This adds real WAL fixtures
   and value assertions.
   
   ### Details
   
   - **Scenarios:** a real 4.1.0-rc01 V1 WAL (no doc-value Map) and a later 4.1 
V1
     WAL (with the doc-value Map) must both be rejected before Variant decode; a
     real master V2 WAL must still round-trip; truncated records and a corrupted
     CRC are rejected before decode; Group Commit async replay keeps SQL NULL, 
JSON
     null, mixed types on one path and sparse values, including after a BE 
restart.
   - **What existing tests miss:** block_variant_wire_format_test.cpp 
manipulates
     PColumnMeta on in-memory PBlocks and never enters WalFileReader/WalReader;
     test_group_commit_variant inserted keys only and never read back the 
Variant
     columns.
   - **Fails when broken:** with the `_serialized_as_v2` guard removed, the V1
     fixtures are decoded as V2 (the production misdecode path), so
     V1WalIsRejectedBeforeVariantDecode fails; changing V2 column decoding or
     replay breaks the round-trip and the generated .out values.
   
   ### Testing
   
   - ./run-be-ut.sh --run --filter=WalVariantWireCompatTest.*: 4/4 passed on 
dev-x.
   - ./run-regression-test.sh --conf tmp/regression-conf.auto.groovy --run -d
     insert_p0 -s test_group_commit_variant: 0 failed suites; the .out was
     generated by the framework.
   - The fixtures are real WAL files written by 4.1.0-rc01, 4.1 HEAD and master.
   
   ### Notes for Reviewers
   
   The V1 fixtures are binary because the failing path is the real WAL entry: 
the
   outer length/CRC plus Block::deserialize, which a synthetic PBlock cannot
   exercise. The V2 fixture's column metadata has no names, so the value check
   identifies the scalar columns by their values.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Ready
   
   ### AI Disclosure
   
   - Tool: DeepSeek Harness (deepseek-flash)
   - Generated: tests, fixtures, PR description
   - Human review: author to review the generated tests and description before 
merge
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to