Skip to content

Conversation

@Mryange
Copy link
Contributor

@Mryange Mryange commented Nov 11, 2025

What problem does this PR solve?

We previously had a crash. The cause is that we should not access the request after calling add_block(...) because add_block may enqueue a closure that runs on another thread and frees the request

==730145==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7be1efd803a0 at pc 0x556b38d9d625 bp 0x7b16bf0193f0 sp 0x7b16bf0193e8
READ of size 4 at 0x7be1efd803a0 thread T1559
    #0 0x556b38d9d624 in google::protobuf::internal::RepeatedPtrFieldBase::size() const /home/zcp/repo_center/doris_master/doris/thirdparty/installed/include/google/protobuf/repeated_ptr_field.h:185:29
    #1 0x556b408ab062 in google::protobuf::RepeatedPtrField<doris::PBlock>::size() const /home/zcp/repo_center/doris_master/doris/thirdparty/installed/include/google/protobuf/repeated_ptr_field.h:1248:32
    #2 0x556b408aaff4 in doris::PTransmitDataParams::_internal_blocks_size() const /home/zcp/repo_center/doris_master/doris/be/../gensrc/build/gen_cpp/internal_service.pb.h:32149:25
    #3 0x556b4089731c in doris::PTransmitDataParams::blocks_size() const /home/zcp/repo_center/doris_master/doris/be/../gensrc/build/gen_cpp/internal_service.pb.h:32152:10
    #4 0x556b60a83c17 in doris::vectorized::VDataStreamMgr::transmit_block(doris::PTransmitDataParams const*, google::protobuf::Closure**, long) /home/zcp/repo_center/doris_master/doris/be/src/vec/runtime/vdata_stream_mgr.cpp:150:38
    #5 0x556b407f7408 in doris::PInternalService::_transmit_block(google::protobuf::RpcController*, doris::PTransmitDataParams const*, doris::PTransmitDataResult*, google::protobuf::Closure*, doris::Status const&, long) /home/zcp/repo_center/doris_master/doris/be/src/service/internal_service.cpp:1673:40
    #6 0x556b407f52bb in doris::PInternalService::transmit_block(google::protobuf::RpcController*, doris::PTransmitDataParams const*, doris::PTransmitDataResult*, google::protobuf::Closure*) /home/zcp/repo_center/doris_master/doris/be/src/service/internal_service.cpp:1610:9
    #7 0x556b43fceba2 in doris::PBackendService::CallMethod(google::protobuf::MethodDescriptor const*, google::protobuf::RpcController*, google::protobuf::Message const*, google::protobuf::Message*, google::protobuf::Closure*) /home/zcp/repo_center/doris_master/doris/gensrc/build/gen_cpp/internal_service.pb.cc:49452:7
    #8 0x556b6736273e in brpc::policy::ProcessRpcRequest(brpc::InputMessageBase*) (/mnt/hdd01/selectdb-cloud-chaos/cluster0/be/lib/doris_be+0x770bd73e)
    #9 0x556b67357426 in brpc::ProcessInputMessage(void*) (/mnt/hdd01/selectdb-cloud-chaos/cluster0/be/lib/doris_be+0x770b2426)
    #10 0x556b67357f20 in brpc::InputMessenger::InputMessageClosure::~InputMessageClosure() (/mnt/hdd01/selectdb-cloud-chaos/cluster0/be/lib/doris_be+0x770b2f20)
    #11 0x556b673588dd in brpc::InputMessenger::OnNewMessages(brpc::Socket*) (/mnt/hdd01/selectdb-cloud-chaos/cluster0/be/lib/doris_be+0x770b38dd)
    #12 0x556b674a0adc in brpc::Socket::ProcessEvent(void*) (/mnt/hdd01/selectdb-cloud-chaos/cluster0/be/lib/doris_be+0x771fbadc)
    #13 0x556b672e0f76 in bthread::TaskGroup::task_runner(long) (/mnt/hdd01/selectdb-cloud-chaos/cluster0/be/lib/doris_be+0x7703bf76)
    #14 0x556b672cbbe0 in bthread_make_fcontext (/mnt/hdd01/selectdb-cloud-chaos/cluster0/be/lib/doris_be+0x77026be0)
        Note: The done pointer will be saved in add_block and may be called in another thread via done->Run().
        For example, when blocks_size == 1, the process is as follows:
        transmit_block (i=0)
          └─> recvr->add_block(..., done, ...)  // Pass done
               └─> SenderQueue::add_block
                    └─> _pending_closures.push(done)  // done is saved

        get_batch() [another thread]
          └─> closure_pair.first->Run()  // ⚠️ done->Run() is called
               └─> brpc releases request and response

        transmit_block (i=1)  [original thread continues]
          └─> request->blocks_size()  // ⚠️ request has already been released!

        At this point, a use-after-free issue occurs.

        TODO: We should consider refactoring this part because add_block may release the request.
        We should not access the request after calling add_block.

#50113

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@Thearas
Copy link
Contributor

Thearas commented Nov 11, 2025

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

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?

@Mryange
Copy link
Contributor Author

Mryange commented Nov 11, 2025

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 34615 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 372a91248b703225da7b1155059a24fb2d5c67b8, data reload: false

------ Round 1 ----------------------------------
q1	17597	5263	5099	5099
q2	2030	331	208	208
q3	10240	1310	746	746
q4	10226	901	367	367
q5	7532	2463	2391	2391
q6	192	165	136	136
q7	928	781	632	632
q8	9353	1355	1173	1173
q9	7073	5265	5159	5159
q10	6904	2213	1839	1839
q11	511	325	287	287
q12	366	375	234	234
q13	17799	3721	3024	3024
q14	235	240	214	214
q15	598	512	498	498
q16	1034	1008	947	947
q17	601	897	385	385
q18	7509	7277	7138	7138
q19	1095	976	576	576
q20	376	348	226	226
q21	3983	3231	2351	2351
q22	1062	1055	985	985
Total cold run time: 107244 ms
Total hot run time: 34615 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5188	5170	5177	5170
q2	253	325	233	233
q3	2224	2705	2331	2331
q4	1347	1807	1353	1353
q5	4239	4701	4565	4565
q6	221	175	131	131
q7	2074	1978	1841	1841
q8	2648	2676	2682	2676
q9	7423	7399	7258	7258
q10	3104	3321	2967	2967
q11	612	535	531	531
q12	692	805	636	636
q13	3537	3919	3393	3393
q14	298	314	277	277
q15	564	521	522	521
q16	1054	1090	1100	1090
q17	1234	1601	1452	1452
q18	7903	7659	7609	7609
q19	843	826	896	826
q20	2000	2048	1949	1949
q21	5146	4508	4347	4347
q22	1090	1027	1023	1023
Total cold run time: 53694 ms
Total hot run time: 52179 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 188302 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 372a91248b703225da7b1155059a24fb2d5c67b8, data reload: false

query1	1070	411	392	392
query2	6561	1723	1737	1723
query3	6761	237	237	237
query4	27123	23376	23554	23376
query5	4395	650	477	477
query6	353	256	239	239
query7	4664	515	317	317
query8	307	262	259	259
query9	8734	2633	2618	2618
query10	485	361	309	309
query11	15856	15108	14940	14940
query12	183	124	120	120
query13	1693	570	446	446
query14	10436	9322	9271	9271
query15	204	194	171	171
query16	7177	690	524	524
query17	1225	787	644	644
query18	1991	436	342	342
query19	220	217	188	188
query20	133	141	126	126
query21	216	132	115	115
query22	3893	4226	3899	3899
query23	33980	33448	33113	33113
query24	8485	2441	2427	2427
query25	629	595	441	441
query26	1254	287	159	159
query27	2734	499	356	356
query28	4330	2220	2202	2202
query29	856	618	487	487
query30	295	222	194	194
query31	881	798	746	746
query32	86	77	76	76
query33	598	391	323	323
query34	812	852	527	527
query35	802	851	777	777
query36	957	1024	895	895
query37	118	110	88	88
query38	3610	3492	3429	3429
query39	1505	1411	1437	1411
query40	222	134	121	121
query41	62	60	61	60
query42	129	111	115	111
query43	486	503	482	482
query44	1282	750	740	740
query45	187	184	173	173
query46	896	987	637	637
query47	1745	1764	1736	1736
query48	395	430	350	350
query49	793	521	441	441
query50	681	691	414	414
query51	3878	3930	3828	3828
query52	114	112	111	111
query53	242	276	206	206
query54	317	297	274	274
query55	90	87	89	87
query56	322	349	343	343
query57	1173	1192	1113	1113
query58	290	274	275	274
query59	2500	2656	2570	2570
query60	361	352	342	342
query61	165	154	163	154
query62	777	750	693	693
query63	230	193	196	193
query64	4572	1181	869	869
query65	4063	3961	3927	3927
query66	1175	451	338	338
query67	15511	15394	14870	14870
query68	8297	950	596	596
query69	489	315	295	295
query70	1355	1288	1231	1231
query71	496	357	320	320
query72	5893	4933	4959	4933
query73	680	609	367	367
query74	9256	9080	8851	8851
query75	3985	3338	2804	2804
query76	3843	1169	752	752
query77	818	406	317	317
query78	9571	9722	8829	8829
query79	2376	846	595	595
query80	640	602	520	520
query81	493	266	238	238
query82	424	158	133	133
query83	315	262	256	256
query84	299	120	97	97
query85	907	511	458	458
query86	342	316	290	290
query87	3701	3727	3629	3629
query88	3084	2258	2253	2253
query89	396	349	297	297
query90	2008	228	223	223
query91	168	168	136	136
query92	82	71	70	70
query93	1182	999	643	643
query94	707	420	328	328
query95	409	329	321	321
query96	496	568	282	282
query97	2963	2978	2893	2893
query98	239	212	210	210
query99	1457	1424	1294	1294
Total cold run time: 275641 ms
Total hot run time: 188302 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 27.68 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 372a91248b703225da7b1155059a24fb2d5c67b8, data reload: false

query1	0.06	0.05	0.04
query2	0.09	0.05	0.05
query3	0.25	0.08	0.08
query4	1.61	0.11	0.12
query5	0.28	0.26	0.25
query6	1.18	0.65	0.65
query7	0.02	0.02	0.02
query8	0.06	0.04	0.04
query9	0.59	0.52	0.51
query10	0.58	0.57	0.58
query11	0.16	0.11	0.11
query12	0.15	0.12	0.12
query13	0.62	0.59	0.60
query14	1.00	1.01	1.00
query15	0.85	0.82	0.83
query16	0.39	0.40	0.40
query17	1.06	1.01	1.01
query18	0.22	0.20	0.20
query19	1.87	1.78	1.77
query20	0.02	0.01	0.01
query21	15.46	0.20	0.13
query22	5.02	0.07	0.04
query23	15.66	0.25	0.10
query24	2.82	0.67	1.12
query25	0.10	0.06	0.05
query26	0.14	0.13	0.12
query27	0.07	0.06	0.06
query28	5.41	1.15	0.92
query29	12.55	3.88	3.31
query30	0.28	0.15	0.11
query31	2.82	0.60	0.37
query32	3.22	0.55	0.48
query33	3.16	3.09	3.02
query34	15.79	5.14	4.55
query35	4.57	4.56	4.58
query36	0.69	0.50	0.49
query37	0.10	0.07	0.06
query38	0.07	0.04	0.04
query39	0.04	0.02	0.03
query40	0.18	0.13	0.13
query41	0.08	0.03	0.04
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 99.37 s
Total hot run time: 27.68 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 73.49% (61/83) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.78% (18235/34547)
Line Coverage 38.16% (165933/434874)
Region Coverage 33.17% (129154/389386)
Branch Coverage 33.89% (55377/163400)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 79.52% (66/83) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.50% (24282/33961)
Line Coverage 58.01% (252684/435594)
Region Coverage 53.51% (211317/394900)
Branch Coverage 54.64% (89881/164483)

@Mryange
Copy link
Contributor Author

Mryange commented Nov 11, 2025

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 34569 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 7128bcba1dff41891284169a193d76ad8d4d6c47, data reload: false

------ Round 1 ----------------------------------
q1	17621	5190	5090	5090
q2	2058	359	208	208
q3	10203	1342	728	728
q4	10241	984	382	382
q5	7542	2471	2369	2369
q6	183	172	136	136
q7	949	768	626	626
q8	9350	1341	1173	1173
q9	7061	5239	5217	5217
q10	6869	2260	1832	1832
q11	499	306	287	287
q12	344	380	242	242
q13	17772	3696	3036	3036
q14	233	240	217	217
q15	581	511	511	511
q16	1033	1016	963	963
q17	603	900	380	380
q18	7354	7161	7007	7007
q19	1085	970	598	598
q20	365	358	221	221
q21	3978	3280	2375	2375
q22	1089	1049	971	971
Total cold run time: 107013 ms
Total hot run time: 34569 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5188	5120	5306	5120
q2	257	323	231	231
q3	2202	2670	2324	2324
q4	1384	1790	1328	1328
q5	4196	4650	4633	4633
q6	213	170	134	134
q7	2020	1950	1848	1848
q8	2661	2573	2614	2573
q9	7401	7305	7321	7305
q10	3054	3316	2906	2906
q11	583	536	500	500
q12	743	808	661	661
q13	3630	4027	3577	3577
q14	296	300	287	287
q15	557	512	495	495
q16	1078	1163	1061	1061
q17	1213	1567	1433	1433
q18	7900	7762	7557	7557
q19	850	939	956	939
q20	2037	2077	1906	1906
q21	5096	4360	4402	4360
q22	1089	1049	1013	1013
Total cold run time: 53648 ms
Total hot run time: 52191 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 187685 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 7128bcba1dff41891284169a193d76ad8d4d6c47, data reload: false

query1	1057	402	424	402
query2	6552	1686	1697	1686
query3	6755	226	224	224
query4	26750	23433	23193	23193
query5	4423	614	467	467
query6	337	230	229	229
query7	4642	488	301	301
query8	302	262	253	253
query9	8698	2609	2618	2609
query10	480	373	300	300
query11	15674	15363	14907	14907
query12	180	121	117	117
query13	1705	576	443	443
query14	11352	9245	9348	9245
query15	214	195	170	170
query16	7688	640	498	498
query17	1225	762	626	626
query18	2039	425	313	313
query19	217	192	169	169
query20	131	121	123	121
query21	216	130	117	117
query22	4014	4020	3976	3976
query23	34085	33100	32820	32820
query24	8439	2376	2415	2376
query25	588	519	472	472
query26	1229	271	159	159
query27	2745	493	350	350
query28	4370	2236	2222	2222
query29	800	607	484	484
query30	311	222	194	194
query31	922	795	723	723
query32	84	70	73	70
query33	590	385	317	317
query34	794	850	513	513
query35	817	805	754	754
query36	958	1006	905	905
query37	114	107	89	89
query38	3525	3565	3406	3406
query39	1493	1405	1398	1398
query40	220	131	118	118
query41	63	60	65	60
query42	125	112	114	112
query43	487	499	473	473
query44	1247	747	748	747
query45	188	185	174	174
query46	879	986	649	649
query47	1782	1801	1744	1744
query48	396	425	316	316
query49	764	499	412	412
query50	638	674	411	411
query51	3877	3903	3889	3889
query52	111	109	106	106
query53	243	272	197	197
query54	317	286	270	270
query55	89	90	87	87
query56	342	317	308	308
query57	1187	1198	1126	1126
query58	293	274	275	274
query59	2529	2644	2573	2573
query60	363	328	333	328
query61	161	157	160	157
query62	826	730	667	667
query63	229	190	191	190
query64	4481	1155	860	860
query65	4052	3930	3936	3930
query66	1082	430	354	354
query67	15172	15407	15022	15022
query68	4799	961	621	621
query69	492	336	307	307
query70	1267	1318	1270	1270
query71	425	339	318	318
query72	6170	5125	5212	5125
query73	679	591	365	365
query74	8884	9064	8654	8654
query75	3312	3323	2837	2837
query76	3344	1134	736	736
query77	517	394	332	332
query78	9688	9746	8950	8950
query79	2691	834	576	576
query80	694	566	490	490
query81	495	259	236	236
query82	669	159	129	129
query83	261	252	246	246
query84	264	114	93	93
query85	991	491	454	454
query86	388	337	309	309
query87	3731	3746	3582	3582
query88	3778	2229	2228	2228
query89	393	336	290	290
query90	1900	221	217	217
query91	166	180	136	136
query92	86	63	66	63
query93	2537	976	642	642
query94	718	442	347	347
query95	403	321	300	300
query96	475	565	280	280
query97	2943	2966	2878	2878
query98	241	219	209	209
query99	1317	1421	1293	1293
Total cold run time: 273376 ms
Total hot run time: 187685 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 27.5 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 7128bcba1dff41891284169a193d76ad8d4d6c47, data reload: false

query1	0.05	0.04	0.05
query2	0.09	0.05	0.05
query3	0.26	0.08	0.09
query4	1.59	0.11	0.12
query5	0.27	0.26	0.25
query6	1.19	0.65	0.62
query7	0.03	0.02	0.02
query8	0.05	0.04	0.05
query9	0.61	0.52	0.52
query10	0.58	0.58	0.56
query11	0.17	0.12	0.11
query12	0.15	0.12	0.12
query13	0.63	0.61	0.61
query14	1.01	1.01	1.00
query15	0.86	0.84	0.83
query16	0.39	0.39	0.41
query17	1.05	1.04	1.03
query18	0.21	0.19	0.20
query19	1.92	1.77	1.82
query20	0.02	0.01	0.01
query21	15.93	0.19	0.13
query22	5.55	0.07	0.05
query23	15.72	0.26	0.09
query24	2.55	1.20	0.56
query25	0.08	0.06	0.06
query26	0.15	0.13	0.14
query27	0.07	0.06	0.05
query28	4.53	1.16	0.92
query29	12.61	3.90	3.24
query30	0.29	0.13	0.11
query31	2.81	0.57	0.39
query32	3.23	0.56	0.46
query33	3.06	3.05	3.03
query34	15.63	5.17	4.50
query35	4.58	4.60	4.59
query36	0.67	0.50	0.49
query37	0.10	0.07	0.07
query38	0.06	0.04	0.03
query39	0.04	0.03	0.03
query40	0.16	0.14	0.13
query41	0.08	0.03	0.03
query42	0.03	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 99.1 s
Total hot run time: 27.5 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 75.47% (80/106) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.83% (18284/34612)
Line Coverage 38.19% (166241/435247)
Region Coverage 33.17% (129189/389461)
Branch Coverage 33.92% (55454/163496)

@Mryange
Copy link
Contributor Author

Mryange commented Nov 11, 2025

run buildall

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 82.08% (87/106) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.52% (24326/34011)
Line Coverage 58.01% (252852/435899)
Region Coverage 53.45% (211079/394946)
Branch Coverage 54.72% (90048/164559)

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 75.47% (80/106) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.83% (18284/34612)
Line Coverage 38.20% (166248/435252)
Region Coverage 33.17% (129196/389463)
Branch Coverage 33.92% (55463/163498)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 82.08% (87/106) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.53% (24328/34012)
Line Coverage 58.01% (252894/435928)
Region Coverage 53.45% (211125/394967)
Branch Coverage 54.72% (90060/164573)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 82.08% (87/106) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.52% (24325/34012)
Line Coverage 58.01% (252862/435928)
Region Coverage 53.47% (211195/394967)
Branch Coverage 54.72% (90054/164573)

@Mryange
Copy link
Contributor Author

Mryange commented Nov 11, 2025

run p0

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 82.08% (87/106) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.52% (24326/34012)
Line Coverage 58.00% (252857/435928)
Region Coverage 53.47% (211180/394967)
Branch Coverage 54.71% (90042/164573)

@Mryange
Copy link
Contributor Author

Mryange commented Nov 12, 2025

run performance

@doris-robot
Copy link

TPC-H: Total hot run time: 34169 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 7128bcba1dff41891284169a193d76ad8d4d6c47, data reload: false

------ Round 1 ----------------------------------
q1	17669	5231	5066	5066
q2	2161	319	207	207
q3	10236	1271	718	718
q4	10292	869	368	368
q5	7441	2353	2317	2317
q6	186	183	138	138
q7	918	777	636	636
q8	9353	1352	1146	1146
q9	7128	5110	5244	5110
q10	6984	2239	1796	1796
q11	491	306	276	276
q12	379	380	240	240
q13	17790	3621	3010	3010
q14	228	242	218	218
q15	574	508	504	504
q16	1010	1013	932	932
q17	585	855	355	355
q18	7841	7258	7041	7041
q19	1154	946	557	557
q20	365	338	230	230
q21	3618	3178	2313	2313
q22	1094	1050	991	991
Total cold run time: 107497 ms
Total hot run time: 34169 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5121	5092	5073	5073
q2	248	329	231	231
q3	2161	2665	2286	2286
q4	1348	1755	1317	1317
q5	4212	4570	4507	4507
q6	213	167	130	130
q7	1983	2015	1893	1893
q8	2709	2690	2554	2554
q9	7374	7352	7162	7162
q10	3098	3330	2798	2798
q11	612	541	514	514
q12	709	819	645	645
q13	3484	4030	3328	3328
q14	307	323	271	271
q15	547	510	522	510
q16	1116	1101	1043	1043
q17	1183	1568	1394	1394
q18	7945	7693	7843	7693
q19	831	857	854	854
q20	1970	2072	1869	1869
q21	4938	4412	4307	4307
q22	1095	1060	995	995
Total cold run time: 53204 ms
Total hot run time: 51374 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 187487 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 7128bcba1dff41891284169a193d76ad8d4d6c47, data reload: false

query1	1194	397	412	397
query2	6574	1729	1646	1646
query3	6764	218	227	218
query4	26142	23460	22954	22954
query5	4413	612	474	474
query6	336	229	233	229
query7	4661	490	293	293
query8	307	246	238	238
query9	8712	2587	2592	2587
query10	465	328	278	278
query11	15321	15170	14754	14754
query12	166	132	114	114
query13	1681	567	441	441
query14	10302	9136	9068	9068
query15	207	185	175	175
query16	7162	633	506	506
query17	1254	745	629	629
query18	1977	404	311	311
query19	206	196	176	176
query20	130	128	123	123
query21	218	132	116	116
query22	4076	4343	4082	4082
query23	33832	32985	33036	32985
query24	8462	2393	2407	2393
query25	630	545	490	490
query26	1255	274	165	165
query27	2758	497	360	360
query28	4389	2228	2210	2210
query29	868	642	510	510
query30	304	220	198	198
query31	919	821	725	725
query32	88	77	75	75
query33	597	399	335	335
query34	802	840	521	521
query35	808	833	758	758
query36	963	991	897	897
query37	121	110	94	94
query38	3568	3524	3490	3490
query39	1521	1435	1428	1428
query40	224	134	124	124
query41	70	65	64	64
query42	134	118	114	114
query43	489	496	469	469
query44	1226	752	750	750
query45	192	180	175	175
query46	877	986	642	642
query47	1793	1826	1747	1747
query48	398	451	325	325
query49	822	538	440	440
query50	646	690	403	403
query51	3831	3844	3841	3841
query52	113	110	105	105
query53	238	271	202	202
query54	326	307	296	296
query55	90	95	85	85
query56	319	318	317	317
query57	1198	1205	1125	1125
query58	304	283	285	283
query59	2546	2766	2606	2606
query60	345	365	361	361
query61	194	223	160	160
query62	812	724	675	675
query63	224	190	192	190
query64	4629	1155	862	862
query65	4000	3917	3931	3917
query66	1173	446	348	348
query67	15663	15082	14860	14860
query68	8317	942	605	605
query69	488	321	288	288
query70	1279	1304	1266	1266
query71	492	333	331	331
query72	6243	4942	4960	4942
query73	682	585	360	360
query74	8855	9164	8992	8992
query75	3963	3301	2878	2878
query76	3741	1185	712	712
query77	812	394	310	310
query78	9506	9783	8847	8847
query79	2346	842	604	604
query80	667	560	501	501
query81	483	262	230	230
query82	426	164	132	132
query83	311	259	242	242
query84	297	107	94	94
query85	946	500	449	449
query86	336	293	289	289
query87	3751	3700	3627	3627
query88	3398	2234	2226	2226
query89	386	333	297	297
query90	2011	215	213	213
query91	171	159	136	136
query92	80	69	58	58
query93	1770	971	647	647
query94	706	451	314	314
query95	401	320	313	313
query96	486	589	284	284
query97	2969	2970	2873	2873
query98	247	216	208	208
query99	1440	1397	1290	1290
Total cold run time: 275035 ms
Total hot run time: 187487 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 27.24 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 7128bcba1dff41891284169a193d76ad8d4d6c47, data reload: false

query1	0.05	0.05	0.05
query2	0.10	0.04	0.05
query3	0.26	0.09	0.08
query4	1.60	0.12	0.12
query5	0.28	0.26	0.24
query6	1.19	0.65	0.65
query7	0.03	0.03	0.03
query8	0.05	0.05	0.04
query9	0.61	0.52	0.52
query10	0.58	0.57	0.58
query11	0.16	0.12	0.11
query12	0.16	0.11	0.12
query13	0.62	0.60	0.60
query14	1.01	0.99	0.99
query15	0.84	0.83	0.83
query16	0.39	0.38	0.38
query17	0.99	1.02	1.03
query18	0.22	0.20	0.20
query19	1.92	1.79	1.83
query20	0.02	0.01	0.01
query21	15.40	0.19	0.14
query22	5.09	0.07	0.04
query23	15.67	0.27	0.10
query24	2.45	0.52	0.37
query25	0.08	0.06	0.06
query26	0.14	0.14	0.14
query27	0.06	0.05	0.05
query28	4.13	1.16	0.93
query29	12.57	3.83	3.18
query30	0.29	0.13	0.12
query31	2.82	0.61	0.38
query32	3.23	0.57	0.47
query33	3.07	3.00	3.19
query34	15.91	5.22	4.56
query35	4.58	4.51	4.60
query36	0.68	0.50	0.48
query37	0.10	0.07	0.06
query38	0.06	0.04	0.03
query39	0.04	0.03	0.03
query40	0.16	0.15	0.13
query41	0.09	0.03	0.03
query42	0.04	0.02	0.02
query43	0.04	0.03	0.04
Total cold run time: 97.78 s
Total hot run time: 27.24 s

}
iter->second = packet_seq;
} else {
_packet_seq_map.emplace(be_number, packet_seq);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the packet_seq seem different with origin logic

@Mryange
Copy link
Contributor Author

Mryange commented Nov 13, 2025

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 34297 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 01f64b3fbac843cdd274768db25ce3a9f3e3cd4b, data reload: false

------ Round 1 ----------------------------------
q1	17626	5197	5067	5067
q2	1999	314	210	210
q3	10292	1295	724	724
q4	10225	890	384	384
q5	7543	2395	2353	2353
q6	181	169	137	137
q7	917	787	644	644
q8	9359	1335	1128	1128
q9	6907	5152	5208	5152
q10	6886	2213	1797	1797
q11	500	310	278	278
q12	372	370	236	236
q13	17795	3655	3082	3082
q14	234	234	211	211
q15	595	514	504	504
q16	1015	1008	945	945
q17	586	886	370	370
q18	7751	7187	6987	6987
q19	1363	957	558	558
q20	366	359	233	233
q21	3842	3244	2297	2297
q22	1090	1010	1000	1000
Total cold run time: 107444 ms
Total hot run time: 34297 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5148	5119	5079	5079
q2	257	327	266	266
q3	2193	2681	2313	2313
q4	1351	1773	1294	1294
q5	4206	4431	4468	4431
q6	216	174	132	132
q7	2079	2023	1874	1874
q8	2598	2605	2565	2565
q9	7332	7232	7327	7232
q10	3064	3258	2788	2788
q11	587	531	515	515
q12	685	821	613	613
q13	3616	3934	3382	3382
q14	290	308	303	303
q15	549	500	518	500
q16	1106	1291	1058	1058
q17	1174	1560	1439	1439
q18	7951	7792	7581	7581
q19	825	823	841	823
q20	1998	2074	1818	1818
q21	4825	4325	4370	4325
q22	1089	1046	996	996
Total cold run time: 53139 ms
Total hot run time: 51327 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 187437 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 01f64b3fbac843cdd274768db25ce3a9f3e3cd4b, data reload: false

query1	1022	400	394	394
query2	6581	1748	1688	1688
query3	6751	222	219	219
query4	26561	23685	22990	22990
query5	4433	631	454	454
query6	350	240	229	229
query7	4660	496	299	299
query8	338	262	277	262
query9	8725	2607	2611	2607
query10	521	331	288	288
query11	15579	15038	14890	14890
query12	188	120	115	115
query13	1685	580	442	442
query14	10398	9307	9282	9282
query15	192	193	171	171
query16	7592	692	477	477
query17	1266	776	620	620
query18	2013	430	328	328
query19	219	209	179	179
query20	129	128	125	125
query21	226	131	113	113
query22	3977	4150	3990	3990
query23	33917	33557	33250	33250
query24	8424	2388	2445	2388
query25	612	556	485	485
query26	1233	273	165	165
query27	2761	512	357	357
query28	4370	2225	2209	2209
query29	829	620	509	509
query30	307	230	199	199
query31	906	843	738	738
query32	88	75	75	75
query33	610	418	314	314
query34	799	849	532	532
query35	824	825	744	744
query36	947	995	877	877
query37	124	108	86	86
query38	3536	3515	3507	3507
query39	1490	1446	1385	1385
query40	224	131	117	117
query41	62	57	58	57
query42	132	113	118	113
query43	495	490	474	474
query44	1236	743	744	743
query45	185	176	166	166
query46	876	984	640	640
query47	1744	1788	1703	1703
query48	386	421	333	333
query49	758	503	424	424
query50	662	681	402	402
query51	3938	3891	3991	3891
query52	109	105	101	101
query53	245	272	198	198
query54	307	295	312	295
query55	85	85	86	85
query56	339	299	324	299
query57	1155	1188	1119	1119
query58	281	275	266	266
query59	2530	2660	2489	2489
query60	334	359	330	330
query61	156	158	159	158
query62	794	720	654	654
query63	228	194	196	194
query64	4494	1141	839	839
query65	4025	3939	3947	3939
query66	1153	446	347	347
query67	15198	15029	14805	14805
query68	8403	875	595	595
query69	490	322	295	295
query70	1347	1275	1306	1275
query71	482	344	310	310
query72	5655	4798	4814	4798
query73	695	571	365	365
query74	8928	8776	8733	8733
query75	3943	3313	2860	2860
query76	3715	1182	741	741
query77	812	396	311	311
query78	9479	9838	8981	8981
query79	1273	815	611	611
query80	637	581	518	518
query81	483	258	230	230
query82	209	160	133	133
query83	280	265	252	252
query84	270	112	98	98
query85	876	477	420	420
query86	340	308	296	296
query87	3731	3733	3576	3576
query88	2829	2263	2216	2216
query89	404	329	291	291
query90	2069	215	214	214
query91	159	174	135	135
query92	80	70	66	66
query93	1108	978	668	668
query94	714	426	332	332
query95	406	324	300	300
query96	486	579	280	280
query97	2901	2980	2867	2867
query98	230	218	208	208
query99	1433	1386	1299	1299
Total cold run time: 272181 ms
Total hot run time: 187437 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 27.58 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 01f64b3fbac843cdd274768db25ce3a9f3e3cd4b, data reload: false

query1	0.06	0.05	0.05
query2	0.09	0.04	0.04
query3	0.26	0.08	0.09
query4	1.61	0.11	0.10
query5	0.27	0.25	0.24
query6	1.18	0.66	0.65
query7	0.03	0.03	0.03
query8	0.06	0.04	0.05
query9	0.58	0.51	0.52
query10	0.57	0.57	0.57
query11	0.15	0.12	0.12
query12	0.16	0.13	0.11
query13	0.62	0.60	0.60
query14	1.01	0.99	1.00
query15	0.85	0.85	0.83
query16	0.40	0.39	0.40
query17	1.01	1.01	1.01
query18	0.21	0.20	0.19
query19	1.93	1.83	1.83
query20	0.01	0.01	0.01
query21	15.44	0.18	0.14
query22	5.07	0.09	0.05
query23	15.66	0.26	0.10
query24	2.75	0.59	1.04
query25	0.08	0.06	0.06
query26	0.15	0.13	0.12
query27	0.07	0.06	0.06
query28	5.26	1.15	0.93
query29	12.63	3.95	3.24
query30	0.28	0.14	0.12
query31	2.81	0.59	0.38
query32	3.22	0.56	0.46
query33	3.06	3.01	3.08
query34	15.97	5.16	4.54
query35	4.55	4.57	4.56
query36	0.68	0.50	0.49
query37	0.09	0.06	0.07
query38	0.07	0.04	0.04
query39	0.04	0.03	0.03
query40	0.19	0.15	0.12
query41	0.09	0.03	0.04
query42	0.04	0.03	0.03
query43	0.05	0.03	0.03
Total cold run time: 99.31 s
Total hot run time: 27.58 s

HappenLee
HappenLee previously approved these changes Nov 13, 2025
Copy link
Contributor

@HappenLee HappenLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 13, 2025
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 75.47% (80/106) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.82% (18281/34612)
Line Coverage 38.18% (166202/435267)
Region Coverage 33.17% (129176/389478)
Branch Coverage 33.91% (55452/163505)

@Mryange
Copy link
Contributor Author

Mryange commented Nov 13, 2025

run buildall

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Nov 13, 2025
@doris-robot
Copy link

TPC-H: Total hot run time: 34721 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 4ece42e09ec63d1cfb7c9b5ddd7e7e1fd18a5e26, data reload: false

------ Round 1 ----------------------------------
q1	17625	5255	5095	5095
q2	2022	325	219	219
q3	10260	1297	739	739
q4	10220	951	376	376
q5	7549	2474	2424	2424
q6	199	187	149	149
q7	950	787	648	648
q8	9382	1385	1099	1099
q9	7091	5219	5190	5190
q10	6918	2265	1842	1842
q11	503	299	290	290
q12	382	377	234	234
q13	17803	3683	3041	3041
q14	239	234	230	230
q15	620	523	507	507
q16	1014	1003	936	936
q17	599	889	371	371
q18	7795	7192	7130	7130
q19	1103	974	583	583
q20	351	340	250	250
q21	3869	3210	2341	2341
q22	1081	1039	1027	1027
Total cold run time: 107575 ms
Total hot run time: 34721 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5222	5371	5181	5181
q2	253	343	235	235
q3	2190	2704	2306	2306
q4	1333	1753	1342	1342
q5	4315	4490	4504	4490
q6	224	173	133	133
q7	2050	2022	1854	1854
q8	2768	2734	2645	2645
q9	7421	7459	7347	7347
q10	3095	3284	2818	2818
q11	600	530	518	518
q12	988	770	631	631
q13	3522	4058	3245	3245
q14	306	316	290	290
q15	554	520	499	499
q16	1081	1134	1069	1069
q17	1172	1629	1398	1398
q18	7957	7922	7605	7605
q19	863	831	878	831
q20	1992	2054	1821	1821
q21	4800	4477	4399	4399
q22	1084	1073	1003	1003
Total cold run time: 53790 ms
Total hot run time: 51660 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 189659 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 4ece42e09ec63d1cfb7c9b5ddd7e7e1fd18a5e26, data reload: false

query1	1030	407	396	396
query2	6565	1704	1723	1704
query3	6763	241	228	228
query4	26395	23603	23529	23529
query5	4410	632	494	494
query6	327	239	231	231
query7	4659	533	311	311
query8	316	270	246	246
query9	8681	2603	2614	2603
query10	516	352	304	304
query11	15682	15497	14912	14912
query12	177	120	118	118
query13	1683	565	430	430
query14	10457	9588	9396	9396
query15	206	188	182	182
query16	7181	663	526	526
query17	1243	764	631	631
query18	1992	414	321	321
query19	217	201	180	180
query20	136	131	120	120
query21	226	133	113	113
query22	3965	4154	3989	3989
query23	34034	33182	33232	33182
query24	8436	2474	2451	2451
query25	626	534	460	460
query26	1249	282	166	166
query27	2747	507	358	358
query28	4368	2217	2188	2188
query29	871	620	488	488
query30	307	239	199	199
query31	904	803	715	715
query32	87	79	76	76
query33	609	399	344	344
query34	827	866	531	531
query35	812	888	761	761
query36	981	997	920	920
query37	125	112	88	88
query38	3591	3608	3516	3516
query39	1501	1523	1406	1406
query40	228	132	131	131
query41	78	60	60	60
query42	131	119	112	112
query43	487	519	466	466
query44	1267	737	742	737
query45	194	184	172	172
query46	894	1012	657	657
query47	1751	1799	1760	1760
query48	398	452	321	321
query49	792	525	423	423
query50	665	709	412	412
query51	3913	3874	4016	3874
query52	115	113	101	101
query53	258	276	200	200
query54	311	303	287	287
query55	94	87	82	82
query56	331	312	326	312
query57	1176	1181	1109	1109
query58	298	290	279	279
query59	2515	2695	2631	2631
query60	360	365	344	344
query61	159	156	167	156
query62	798	743	659	659
query63	234	199	195	195
query64	4651	1284	968	968
query65	4065	3982	3963	3963
query66	1196	471	361	361
query67	15709	15482	15140	15140
query68	4833	932	618	618
query69	516	331	309	309
query70	1380	1338	1287	1287
query71	443	359	327	327
query72	6400	5148	4974	4974
query73	676	616	368	368
query74	8886	9060	8902	8902
query75	3376	3399	2842	2842
query76	3271	1178	765	765
query77	509	409	330	330
query78	9769	9856	8954	8954
query79	1949	847	610	610
query80	692	594	521	521
query81	511	260	230	230
query82	247	163	136	136
query83	277	274	264	264
query84	261	113	93	93
query85	929	499	458	458
query86	379	318	283	283
query87	3757	3758	3590	3590
query88	2950	2323	2276	2276
query89	395	346	299	299
query90	1965	224	230	224
query91	171	180	150	150
query92	80	73	66	66
query93	1661	992	652	652
query94	716	458	341	341
query95	410	320	322	320
query96	497	573	285	285
query97	2938	2998	2912	2912
query98	237	215	216	215
query99	1351	1479	1333	1333
Total cold run time: 270402 ms
Total hot run time: 189659 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 27.59 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 4ece42e09ec63d1cfb7c9b5ddd7e7e1fd18a5e26, data reload: false

query1	0.06	0.05	0.06
query2	0.09	0.05	0.06
query3	0.26	0.09	0.08
query4	1.61	0.12	0.11
query5	0.27	0.25	0.25
query6	1.17	0.66	0.63
query7	0.03	0.02	0.02
query8	0.05	0.04	0.04
query9	0.58	0.53	0.51
query10	0.59	0.58	0.56
query11	0.17	0.11	0.11
query12	0.16	0.12	0.12
query13	0.62	0.61	0.60
query14	1.00	1.00	0.99
query15	0.86	0.84	0.85
query16	0.39	0.41	0.39
query17	1.04	1.06	1.02
query18	0.21	0.20	0.21
query19	1.88	1.81	1.84
query20	0.01	0.02	0.01
query21	15.45	0.21	0.13
query22	5.03	0.06	0.04
query23	15.67	0.26	0.10
query24	3.24	0.63	0.42
query25	0.09	0.07	0.06
query26	0.13	0.13	0.14
query27	0.08	0.07	0.05
query28	4.09	1.15	0.94
query29	12.60	3.94	3.30
query30	0.29	0.16	0.12
query31	2.82	0.59	0.39
query32	3.24	0.56	0.47
query33	3.09	3.04	3.07
query34	15.74	5.18	4.57
query35	4.59	4.59	4.56
query36	0.68	0.50	0.50
query37	0.11	0.08	0.07
query38	0.07	0.05	0.05
query39	0.04	0.03	0.04
query40	0.18	0.16	0.14
query41	0.09	0.04	0.03
query42	0.04	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 98.46 s
Total hot run time: 27.59 s

@Mryange
Copy link
Contributor Author

Mryange commented Nov 13, 2025

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 34452 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 61d3fe4603c807745b101fdbc613af9b268ccf5c, data reload: false

------ Round 1 ----------------------------------
q1	17606	5237	5118	5118
q2	1996	307	207	207
q3	10290	1302	733	733
q4	10245	872	374	374
q5	7571	2409	2343	2343
q6	184	166	135	135
q7	931	773	624	624
q8	9349	1330	1180	1180
q9	7054	5115	5065	5065
q10	6876	2215	1814	1814
q11	498	304	290	290
q12	371	364	232	232
q13	17823	3615	3055	3055
q14	233	232	216	216
q15	574	521	502	502
q16	997	1001	931	931
q17	586	852	378	378
q18	7448	7158	7163	7158
q19	1385	975	605	605
q20	368	347	233	233
q21	4105	3315	2274	2274
q22	1064	1049	985	985
Total cold run time: 107554 ms
Total hot run time: 34452 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5228	5209	5118	5118
q2	254	320	246	246
q3	2152	2694	2329	2329
q4	1375	1800	1302	1302
q5	4148	4502	4484	4484
q6	213	179	129	129
q7	2052	1871	1893	1871
q8	2705	2557	2558	2557
q9	7572	7245	7409	7245
q10	3054	3244	2802	2802
q11	587	537	505	505
q12	660	826	616	616
q13	3443	3976	3439	3439
q14	287	298	277	277
q15	548	507	505	505
q16	1085	1147	1099	1099
q17	1201	1627	1393	1393
q18	7825	7702	7619	7619
q19	790	792	971	792
q20	1902	1970	1817	1817
q21	4692	4367	4292	4292
q22	1086	1050	1014	1014
Total cold run time: 52859 ms
Total hot run time: 51451 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 188831 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 61d3fe4603c807745b101fdbc613af9b268ccf5c, data reload: false

query1	1052	403	400	400
query2	6563	1704	1708	1704
query3	6765	235	238	235
query4	25988	23737	23376	23376
query5	4832	645	492	492
query6	349	246	230	230
query7	4641	499	300	300
query8	322	256	262	256
query9	8718	2623	2594	2594
query10	514	360	307	307
query11	15418	15059	14847	14847
query12	181	125	118	118
query13	1694	576	444	444
query14	11002	9379	9295	9295
query15	216	192	176	176
query16	7726	662	493	493
query17	1227	782	643	643
query18	2043	433	327	327
query19	222	221	183	183
query20	132	130	131	130
query21	219	137	114	114
query22	4174	4024	4174	4024
query23	33881	33122	33159	33122
query24	8512	2431	2422	2422
query25	609	539	486	486
query26	1301	269	157	157
query27	2743	497	350	350
query28	4380	2209	2195	2195
query29	785	614	482	482
query30	297	222	197	197
query31	919	851	756	756
query32	85	79	75	75
query33	598	385	325	325
query34	797	831	518	518
query35	799	831	740	740
query36	967	1032	895	895
query37	128	114	93	93
query38	3562	3591	3609	3591
query39	1508	1434	1421	1421
query40	222	127	121	121
query41	67	61	68	61
query42	128	113	117	113
query43	499	515	463	463
query44	1232	738	736	736
query45	185	181	176	176
query46	885	985	632	632
query47	1741	1764	1705	1705
query48	388	417	325	325
query49	778	535	453	453
query50	663	687	404	404
query51	3878	4089	3911	3911
query52	111	112	108	108
query53	252	267	201	201
query54	305	300	281	281
query55	88	85	88	85
query56	335	324	309	309
query57	1244	1201	1109	1109
query58	286	276	274	274
query59	2533	2666	2566	2566
query60	360	355	328	328
query61	164	156	157	156
query62	783	709	671	671
query63	237	199	199	199
query64	4375	1172	886	886
query65	4036	3936	3977	3936
query66	1111	446	333	333
query67	15167	15331	15178	15178
query68	8324	930	596	596
query69	503	332	292	292
query70	1311	1286	1283	1283
query71	487	325	322	322
query72	6075	4912	5095	4912
query73	702	635	361	361
query74	8916	8858	8994	8858
query75	3912	3315	2825	2825
query76	3744	1156	711	711
query77	807	403	313	313
query78	9639	9703	8953	8953
query79	2442	794	614	614
query80	692	634	512	512
query81	525	266	238	238
query82	508	163	127	127
query83	280	269	250	250
query84	256	117	97	97
query85	947	486	436	436
query86	396	319	299	299
query87	3702	3689	3638	3638
query88	3915	2260	2223	2223
query89	386	335	299	299
query90	2004	228	220	220
query91	174	166	138	138
query92	91	75	64	64
query93	2081	1009	643	643
query94	660	463	373	373
query95	414	326	312	312
query96	499	613	287	287
query97	2947	2971	2890	2890
query98	253	222	212	212
query99	1327	1401	1300	1300
Total cold run time: 276841 ms
Total hot run time: 188831 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 27.6 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 61d3fe4603c807745b101fdbc613af9b268ccf5c, data reload: false

query1	0.06	0.05	0.05
query2	0.10	0.05	0.04
query3	0.25	0.09	0.08
query4	1.61	0.12	0.10
query5	0.28	0.25	0.26
query6	1.16	0.66	0.64
query7	0.03	0.03	0.02
query8	0.06	0.04	0.05
query9	0.58	0.53	0.51
query10	0.58	0.57	0.58
query11	0.16	0.11	0.12
query12	0.15	0.12	0.12
query13	0.63	0.60	0.60
query14	1.01	1.00	1.00
query15	0.85	0.83	0.83
query16	0.39	0.39	0.40
query17	1.00	1.03	1.02
query18	0.22	0.20	0.20
query19	1.94	1.83	1.83
query20	0.01	0.02	0.01
query21	15.44	0.20	0.12
query22	5.09	0.06	0.04
query23	15.66	0.26	0.11
query24	3.38	0.55	0.70
query25	0.08	0.06	0.07
query26	0.14	0.12	0.12
query27	0.08	0.06	0.06
query28	4.74	1.12	0.93
query29	12.55	3.99	3.26
query30	0.28	0.14	0.13
query31	2.82	0.60	0.38
query32	3.23	0.56	0.46
query33	3.09	3.00	3.14
query34	15.91	5.23	4.55
query35	4.57	4.58	4.63
query36	0.66	0.50	0.50
query37	0.10	0.07	0.06
query38	0.06	0.04	0.04
query39	0.03	0.03	0.03
query40	0.16	0.15	0.13
query41	0.08	0.04	0.03
query42	0.04	0.02	0.02
query43	0.05	0.03	0.03
Total cold run time: 99.31 s
Total hot run time: 27.6 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 75.47% (80/106) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.81% (18281/34619)
Line Coverage 38.17% (166207/435385)
Region Coverage 33.19% (129290/389574)
Branch Coverage 33.90% (55454/163564)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 82.08% (87/106) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.55% (24339/34019)
Line Coverage 58.03% (253033/436061)
Region Coverage 53.45% (211165/395078)
Branch Coverage 54.73% (90106/164639)

Copy link
Contributor

@HappenLee HappenLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 17, 2025
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

_done_cb = nullptr;
_wait_timer.stop();
int64_t elapse_time = _wait_timer.elapsed_time();
if (recvr->_max_wait_to_process_time->value() < elapse_time) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a CAS here

@Gabriel39 Gabriel39 merged commit 6deeab8 into apache:master Nov 17, 2025
37 of 38 checks passed
nagisa-kunhah pushed a commit to nagisa-kunhah/doris that referenced this pull request Dec 14, 2025
…57888)

We previously had a crash. The cause is that we should not access the
request after calling add_block(...) because add_block may enqueue a
closure that runs on another thread and frees the request

```
==730145==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7be1efd803a0 at pc 0x556b38d9d625 bp 0x7b16bf0193f0 sp 0x7b16bf0193e8
READ of size 4 at 0x7be1efd803a0 thread T1559
    #0 0x556b38d9d624 in google::protobuf::internal::RepeatedPtrFieldBase::size() const /home/zcp/repo_center/doris_master/doris/thirdparty/installed/include/google/protobuf/repeated_ptr_field.h:185:29
    apache#1 0x556b408ab062 in google::protobuf::RepeatedPtrField<doris::PBlock>::size() const /home/zcp/repo_center/doris_master/doris/thirdparty/installed/include/google/protobuf/repeated_ptr_field.h:1248:32
    apache#2 0x556b408aaff4 in doris::PTransmitDataParams::_internal_blocks_size() const /home/zcp/repo_center/doris_master/doris/be/../gensrc/build/gen_cpp/internal_service.pb.h:32149:25
    apache#3 0x556b4089731c in doris::PTransmitDataParams::blocks_size() const /home/zcp/repo_center/doris_master/doris/be/../gensrc/build/gen_cpp/internal_service.pb.h:32152:10
    apache#4 0x556b60a83c17 in doris::vectorized::VDataStreamMgr::transmit_block(doris::PTransmitDataParams const*, google::protobuf::Closure**, long) /home/zcp/repo_center/doris_master/doris/be/src/vec/runtime/vdata_stream_mgr.cpp:150:38
    apache#5 0x556b407f7408 in doris::PInternalService::_transmit_block(google::protobuf::RpcController*, doris::PTransmitDataParams const*, doris::PTransmitDataResult*, google::protobuf::Closure*, doris::Status const&, long) /home/zcp/repo_center/doris_master/doris/be/src/service/internal_service.cpp:1673:40
    apache#6 0x556b407f52bb in doris::PInternalService::transmit_block(google::protobuf::RpcController*, doris::PTransmitDataParams const*, doris::PTransmitDataResult*, google::protobuf::Closure*) /home/zcp/repo_center/doris_master/doris/be/src/service/internal_service.cpp:1610:9
    apache#7 0x556b43fceba2 in doris::PBackendService::CallMethod(google::protobuf::MethodDescriptor const*, google::protobuf::RpcController*, google::protobuf::Message const*, google::protobuf::Message*, google::protobuf::Closure*) /home/zcp/repo_center/doris_master/doris/gensrc/build/gen_cpp/internal_service.pb.cc:49452:7
    apache#8 0x556b6736273e in brpc::policy::ProcessRpcRequest(brpc::InputMessageBase*) (/mnt/hdd01/selectdb-cloud-chaos/cluster0/be/lib/doris_be+0x770bd73e)
    apache#9 0x556b67357426 in brpc::ProcessInputMessage(void*) (/mnt/hdd01/selectdb-cloud-chaos/cluster0/be/lib/doris_be+0x770b2426)
    apache#10 0x556b67357f20 in brpc::InputMessenger::InputMessageClosure::~InputMessageClosure() (/mnt/hdd01/selectdb-cloud-chaos/cluster0/be/lib/doris_be+0x770b2f20)
    apache#11 0x556b673588dd in brpc::InputMessenger::OnNewMessages(brpc::Socket*) (/mnt/hdd01/selectdb-cloud-chaos/cluster0/be/lib/doris_be+0x770b38dd)
    apache#12 0x556b674a0adc in brpc::Socket::ProcessEvent(void*) (/mnt/hdd01/selectdb-cloud-chaos/cluster0/be/lib/doris_be+0x771fbadc)
    apache#13 0x556b672e0f76 in bthread::TaskGroup::task_runner(long) (/mnt/hdd01/selectdb-cloud-chaos/cluster0/be/lib/doris_be+0x7703bf76)
    apache#14 0x556b672cbbe0 in bthread_make_fcontext (/mnt/hdd01/selectdb-cloud-chaos/cluster0/be/lib/doris_be+0x77026be0)
```

```
        Note: The done pointer will be saved in add_block and may be called in another thread via done->Run().
        For example, when blocks_size == 1, the process is as follows:
        transmit_block (i=0)
          └─> recvr->add_block(..., done, ...)  // Pass done
               └─> SenderQueue::add_block
                    └─> _pending_closures.push(done)  // done is saved

        get_batch() [another thread]
          └─> closure_pair.first->Run()  // ⚠️ done->Run() is called
               └─> brpc releases request and response

        transmit_block (i=1)  [original thread continues]
          └─> request->blocks_size()  // ⚠️ request has already been released!

        At this point, a use-after-free issue occurs.

        TODO: We should consider refactoring this part because add_block may release the request.
        We should not access the request after calling add_block.
```


apache#50113
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants