You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "eldenmoon (via GitHub)" <gi...@apache.org> on 2026/10/22 05:36:31 UTC
[PR] [fix](be) Reject legacy Variant blocks before deserialization [doris]
eldenmoon opened a new pull request, #69434:
URL: https://github.com/apache/doris/pull/69434
### What problem does this PR solve?
Problem Summary: During a mixed-version upgrade, a backend can receive a Variant V1 block while its type factory always creates Variant V2 columns. The layouts differ, so decoding the old payload as V2 can read invalid lengths and crash during an import or exchange.
Validate the existing `variant_is_v2` metadata for every column, including ARRAY/MAP/STRUCT children, before decompressing or decoding any payload. Return an explicit unsupported-format error for V1 blocks. This does not change the wire layout or `be_exec_version`.
This receiver-side check protects updated backends. It does not add sender-side capability negotiation or bounded payload decoding, and does not make an unpatched old receiver safe.
### Release note
Return an explicit error for incompatible Variant V1 blocks received by a Variant V2 backend.
### Check List (For Author)
- Test: ASAN focused `BlockVariantWireFormatTest.*:BlockTest.*`, **33/33 passed** (5 added tests and 28 existing Block tests). The missing-rejection case fails before the fix. Repository clang-format 16, build hygiene and clang-tidy passed.
- Validation limit: the full BE UT build fails in unchanged `function_string_test.cpp:2971-2987` on the base revision (`Field` string construction and removed `FunctionContext` constants). The focused run temporarily selected Block/test utility sources and the two existing shared test implementations needed for linking in local CMake; that selection was restored before committing. No mixed-version cluster run was performed.
- Behavior changed: Yes; incompatible Variant V1 blocks fail before payload decoding.
- Does this need documentation: No
This PR targets master only. The 4.1 branch retains a V1 reader and needs its own guard for the older V1 layout without doc-value data; this condition should not be cherry-picked unchanged.
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [fix](be) Reject legacy Variant blocks before deserialization [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #69434:
URL: https://github.com/apache/doris/pull/69434#issuecomment-6333595770
Thank you for your contribution to Apache Doris.
Don't know what should be done next? See [How to process your PR](https://doris.apache.org/community/how-to-contribute/review-and-ci).
Please clearly describe your PR:
1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
3. What features were added. Why was this function added?
4. Which code was refactored and why was this part of the code refactored?
5. Which functions were optimized and what is the difference before and after the optimization?
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [fix](be) Reject legacy Variant blocks before deserialization [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #69434:
URL: https://github.com/apache/doris/pull/69434#issuecomment-6347612735
<details>
<summary>TPC-H: <b>Total hot run time: 28394 ms</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 9daba71396e9cfb4d9dca4ed94e28cfeabeb6180, data reload: false
------ Round 1 ----------------------------------
============================================
q1 17627 5156 5047 5047
q2 2138 348 251 251
q3 10184 1347 831 831
q4 4671 456 332 332
q5 7421 801 538 538
q6 181 207 156 156
q7 738 793 606 606
q8 9254 1291 1121 1121
q9 5399 4205 4176 4176
q10 6835 1296 1029 1029
q11 437 241 232 232
q12 631 394 284 284
q13 18108 3563 2970 2970
q14 276 260 245 245
q15 q16 723 703 653 653
q17 1206 747 580 580
q18 6988 6172 6132 6132
q19 1101 938 635 635
q20 375 338 222 222
q21 5173 2101 2301 2101
q22 344 296 253 253
Total cold run time: 99810 ms
Total hot run time: 28394 ms
----- Round 2, with runtime_filter_mode=off -----
============================================
q1 5606 5576 5563 5563
q2 658 575 560 560
q3 5236 5385 4884 4884
q4 1982 2126 1524 1524
q5 5307 5166 5535 5166
q6 270 216 165 165
q7 2303 2008 1926 1926
q8 2991 2698 2597 2597
q9 8009 7889 7966 7889
q10 3718 3646 3247 3247
q11 611 625 445 445
q12 677 685 514 514
q13 3507 3825 3276 3276
q14 332 324 304 304
q15 q16 680 750 645 645
q17 8290 7204 6924 6924
q18 13000 12207 12798 12207
q19 892 765 770 765
q20 2130 2144 1912 1912
q21 5478 4523 4671 4523
q22 514 448 410 410
Total cold run time: 72191 ms
Total hot run time: 65446 ms
```
</details>
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [fix](be) Reject legacy Variant blocks before deserialization [doris]
Posted by "eldenmoon (via GitHub)" <gi...@apache.org>.
eldenmoon merged PR #69434:
URL: https://github.com/apache/doris/pull/69434
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [fix](be) Reject legacy Variant blocks before deserialization [doris]
Posted by "eldenmoon (via GitHub)" <gi...@apache.org>.
eldenmoon commented on PR #69434:
URL: https://github.com/apache/doris/pull/69434#issuecomment-6337911761
run buildall
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [fix](be) Reject legacy Variant blocks before deserialization [doris]
Posted by "eldenmoon (via GitHub)" <gi...@apache.org>.
eldenmoon commented on PR #69434:
URL: https://github.com/apache/doris/pull/69434#issuecomment-6338072447
/review
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [fix](be) Reject legacy Variant blocks before deserialization [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #69434:
URL: https://github.com/apache/doris/pull/69434#issuecomment-6347810067
<details>
<summary>TPC-DS: <b>Total hot run time: 150399 ms</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 9daba71396e9cfb4d9dca4ed94e28cfeabeb6180, data reload: false
query5 4307 593 448 448
query6 419 202 195 195
query7 4798 439 239 239
query8 334 165 157 157
query9 8776 3046 3088 3046
query10 457 301 259 259
query11 6059 3835 3554 3554
query12 147 93 87 87
query13 1254 445 341 341
query14 6131 3890 3612 3612
query14_1 3422 3386 3429 3386
query15 221 199 184 184
query16 966 452 426 426
query17 844 689 543 543
query18 2433 424 309 309
query19 199 176 152 152
query20 86 85 83 83
query21 213 129 110 110
query22 12957 13017 12761 12761
query23 13454 12824 12516 12516
query23_1 12436 12453 12524 12453
query24 7374 808 466 466
query24_1 466 483 477 477
query25 541 424 358 358
query26 1250 261 146 146
query27 2753 437 270 270
query28 4641 1915 1917 1915
query29 1555 592 450 450
query30 298 213 178 178
query31 1013 920 819 819
query32 145 97 96 96
query33 529 301 249 249
query34 884 845 524 524
query35 739 763 651 651
query36 825 815 730 730
query37 123 100 83 83
query38 1768 1744 1654 1654
query39 793 794 737 737
query39_1 730 729 744 729
query40 223 117 96 96
query41 72 68 68 68
query42 88 84 81 81
query43 337 365 317 317
query44 1295 678 679 678
query45 182 176 169 169
query46 823 953 561 561
query47 2858 2969 2783 2783
query48 283 296 209 209
query49 566 395 286 286
query50 652 276 204 204
query51 10676 10452 10567 10452
query52 85 79 69 69
query53 190 200 147 147
query54 227 184 190 184
query55 69 67 66 66
query56 222 210 199 199
query57 1641 1627 1555 1555
query58 291 274 252 252
query59 2135 2223 1886 1886
query60 286 240 221 221
query61 147 145 145 145
query62 381 335 283 283
query63 181 158 158 158
query64 2748 970 776 776
query65 3329 3275 3242 3242
query66 1779 412 305 305
query67 20592 20007 19973 19973
query68 3004 975 603 603
query69 368 298 253 253
query70 864 776 770 770
query71 291 234 213 213
query72 2784 2618 2272 2272
query73 517 523 298 298
query74 4606 4498 4320 4320
query75 2313 2279 1899 1899
query76 2304 1010 599 599
query77 338 367 269 269
query78 9990 9681 9199 9199
query79 969 893 509 509
query80 886 430 334 334
query81 580 322 269 269
query82 573 131 104 104
query83 326 195 182 182
query84 310 125 100 100
query85 948 424 377 377
query86 356 235 226 226
query87 1995 1928 1794 1794
query88 3631 2655 2627 2627
query89 334 283 237 237
query90 1780 164 165 164
query91 162 150 128 128
query92 96 90 85 85
query93 977 984 572 572
query94 510 313 245 245
query95 575 385 291 291
query96 679 469 230 230
query97 2459 2457 2316 2316
query98 159 150 147 147
query99 766 761 660 660
Total cold run time: 234897 ms
Total hot run time: 150399 ms
```
</details>
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [fix](be) Reject legacy Variant blocks before deserialization [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #69434:
URL: https://github.com/apache/doris/pull/69434#issuecomment-6347907110
<details>
<summary>ClickBench: <b>Total hot run time: 24.28 s</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 9daba71396e9cfb4d9dca4ed94e28cfeabeb6180, data reload: false
query1 0.01 0.01 0.01
query2 0.09 0.05 0.04
query3 0.25 0.08 0.09
query4 1.62 0.10 0.10
query5 0.23 0.24 0.24
query6 1.18 0.68 0.68
query7 0.04 0.00 0.00
query8 0.06 0.04 0.04
query9 0.40 0.35 0.35
query10 0.61 0.57 0.59
query11 0.21 0.15 0.14
query12 0.18 0.14 0.14
query13 0.48 0.50 0.49
query14 1.05 1.03 1.04
query15 0.63 0.60 0.60
query16 0.36 0.34 0.35
query17 1.12 1.09 1.16
query18 0.21 0.20 0.18
query19 2.11 1.91 2.02
query20 0.02 0.02 0.01
query21 15.48 0.21 0.14
query22 4.91 0.05 0.06
query23 16.28 0.33 0.12
query24 3.00 0.53 0.47
query25 0.10 0.07 0.05
query26 1.46 0.21 0.14
query27 0.05 0.03 0.03
query28 3.56 0.79 0.35
query29 12.48 4.12 3.25
query30 0.28 0.14 0.11
query31 2.77 0.55 0.32
query32 3.22 0.59 0.51
query33 3.12 3.28 3.16
query34 15.39 3.97 3.41
query35 3.34 3.36 3.35
query36 0.54 0.46 0.44
query37 0.09 0.06 0.06
query38 0.05 0.04 0.03
query39 0.04 0.03 0.03
query40 0.18 0.15 0.13
query41 0.09 0.03 0.03
query42 0.04 0.03 0.03
query43 0.04 0.04 0.03
Total cold run time: 97.37 s
Total hot run time: 24.28 s
```
</details>
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [fix](be) Reject legacy Variant blocks before deserialization [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #69434:
URL: https://github.com/apache/doris/pull/69434#issuecomment-6407731173
# BE Regression && UT Coverage Report
Increment line coverage `100% (0/0)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/69434_9daba71396e9cfb4d9dca4ed94e28cfeabeb6180_merge/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/69434_9daba71396e9cfb4d9dca4ed94e28cfeabeb6180_merge/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 77.27% (35970/46551) |
| Line Coverage | 62.49% (406028/649710) |
| Region Coverage | 59.04% (343563/581940) |
| Branch Coverage | 59.93% (158696/264811) |
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org