Skip to content

Conversation

@HappenLee
Copy link
Contributor

@HappenLee HappenLee commented Apr 16, 2025

What problem does this PR solve?

  1. Rmove unless channel ptr in trans struct to reduce mem consume
  2. Send multi block one time in one rpc

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

@hello-stephen
Copy link
Contributor

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?

@HappenLee
Copy link
Contributor Author

run buildall

1 similar comment
@HappenLee
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity cloud ut coverage result:
Function Coverage: 83.00% (1089/1312)
Line Coverage: 66.09% (18176/27500)
Region Coverage: 65.54% (8957/13666)
Branch Coverage: 55.34% (4822/8714)
Coverage Report: http://coverage.selectdb-in.cc/coverage/70c0314f418111c8954306894e0f680a7da0657e_70c0314f418111c8954306894e0f680a7da0657e_cloud/report/index.html

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	26061	5186	5079	5079
q2	2078	286	182	182
q3	10401	1274	688	688
q4	10218	986	526	526
q5	7527	2352	2391	2352
q6	183	166	133	133
q7	933	748	624	624
q8	9329	1311	1098	1098
q9	6695	5158	5114	5114
q10	6878	2326	1963	1963
q11	491	285	269	269
q12	358	359	217	217
q13	17772	3714	3074	3074
q14	233	226	202	202
q15	535	510	489	489
q16	448	453	404	404
q17	588	840	380	380
q18	7628	7175	7199	7175
q19	1890	966	550	550
q20	331	325	218	218
q21	3983	2649	2437	2437
q22	1023	999	929	929
Total cold run time: 115583 ms
Total hot run time: 34103 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5276	5491	5116	5116
q2	242	329	240	240
q3	2149	2638	2320	2320
q4	1447	1811	1387	1387
q5	4495	4453	4423	4423
q6	221	165	133	133
q7	2004	1933	1776	1776
q8	2619	2511	2463	2463
q9	7309	7233	7079	7079
q10	3053	3174	2743	2743
q11	582	503	492	492
q12	715	753	627	627
q13	3460	3907	3264	3264
q14	308	350	266	266
q15	519	476	469	469
q16	462	503	459	459
q17	1149	1539	1423	1423
q18	7696	7682	7422	7422
q19	803	806	848	806
q20	1961	1997	1837	1837
q21	5346	4893	4786	4786
q22	1087	1075	1030	1030
Total cold run time: 52903 ms
Total hot run time: 50561 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 192556 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 70c0314f418111c8954306894e0f680a7da0657e, data reload: false

query1	1378	1063	1085	1063
query2	6234	1878	1874	1874
query3	11020	4620	4595	4595
query4	54528	25853	22975	22975
query5	5046	548	455	455
query6	341	203	207	203
query7	4885	497	288	288
query8	305	245	241	241
query9	5407	2569	2584	2569
query10	441	327	271	271
query11	15936	14922	14885	14885
query12	165	111	109	109
query13	1032	523	391	391
query14	10361	6479	6277	6277
query15	204	183	184	183
query16	7114	647	483	483
query17	1096	726	590	590
query18	1565	403	316	316
query19	198	195	173	173
query20	130	129	123	123
query21	199	126	107	107
query22	4398	4250	4332	4250
query23	34200	33489	33373	33373
query24	6588	2409	2456	2409
query25	486	463	392	392
query26	677	270	155	155
query27	2284	507	341	341
query28	3130	2157	2159	2157
query29	564	572	457	457
query30	276	220	193	193
query31	869	838	792	792
query32	72	64	67	64
query33	458	380	316	316
query34	765	903	517	517
query35	796	853	765	765
query36	922	1020	898	898
query37	122	106	79	79
query38	4195	4174	4229	4174
query39	1495	1463	1488	1463
query40	213	121	109	109
query41	55	57	50	50
query42	124	111	106	106
query43	511	511	478	478
query44	1296	816	819	816
query45	185	184	164	164
query46	847	1042	656	656
query47	1829	1907	1758	1758
query48	398	423	309	309
query49	685	493	438	438
query50	662	709	422	422
query51	4301	4232	4186	4186
query52	117	101	102	101
query53	225	266	191	191
query54	580	580	523	523
query55	86	85	85	85
query56	340	294	284	284
query57	1143	1185	1129	1129
query58	265	255	259	255
query59	2770	2814	2618	2618
query60	340	321	317	317
query61	131	158	132	132
query62	706	736	672	672
query63	235	186	181	181
query64	1558	1127	794	794
query65	4447	4487	4270	4270
query66	737	406	301	301
query67	15841	15515	15373	15373
query68	7825	883	504	504
query69	546	314	263	263
query70	1202	1089	1126	1089
query71	506	311	284	284
query72	5980	4941	4855	4855
query73	1542	658	351	351
query74	8955	9023	9061	9023
query75	3946	3217	2715	2715
query76	4188	1189	762	762
query77	659	374	283	283
query78	10003	9913	9281	9281
query79	3145	830	550	550
query80	634	516	442	442
query81	486	252	220	220
query82	471	127	99	99
query83	324	247	231	231
query84	293	105	83	83
query85	777	348	308	308
query86	369	297	270	270
query87	4603	4502	4357	4357
query88	3835	2253	2252	2252
query89	395	322	276	276
query90	1825	223	216	216
query91	146	145	112	112
query92	70	69	57	57
query93	2090	964	585	585
query94	658	415	305	305
query95	372	288	282	282
query96	496	567	280	280
query97	3153	3199	3097	3097
query98	226	213	198	198
query99	1434	1389	1242	1242
Total cold run time: 301663 ms
Total hot run time: 192556 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.02
query2	0.15	0.11	0.11
query3	0.35	0.20	0.20
query4	1.59	0.20	0.20
query5	0.63	0.62	0.62
query6	1.20	0.73	0.72
query7	0.02	0.02	0.02
query8	0.05	0.05	0.05
query9	0.63	0.51	0.51
query10	0.58	0.58	0.57
query11	0.25	0.13	0.12
query12	0.25	0.13	0.13
query13	0.63	0.63	0.61
query14	1.15	1.19	1.20
query15	0.98	0.88	0.87
query16	0.36	0.37	0.36
query17	1.06	1.00	1.04
query18	0.19	0.18	0.18
query19	1.96	1.79	1.82
query20	0.01	0.01	0.01
query21	15.42	0.97	0.67
query22	0.93	0.99	0.84
query23	14.68	1.57	0.79
query24	5.70	0.56	0.29
query25	0.17	0.10	0.09
query26	0.54	0.22	0.18
query27	0.09	0.09	0.08
query28	11.02	1.17	0.57
query29	12.55	4.03	3.39
query30	0.28	0.08	0.05
query31	2.84	0.62	0.42
query32	3.24	0.59	0.49
query33	3.05	3.02	3.23
query34	16.77	5.07	4.38
query35	4.50	4.46	4.45
query36	0.64	0.51	0.50
query37	0.19	0.16	0.18
query38	0.17	0.15	0.15
query39	0.05	0.03	0.04
query40	0.18	0.16	0.16
query41	0.11	0.06	0.05
query42	0.05	0.04	0.05
query43	0.05	0.04	0.04
Total cold run time: 105.3 s
Total hot run time: 30.12 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 46.58% (68/146) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.15% (14423/27135)
Line Coverage 42.00% (125000/297605)
Region Coverage 40.81% (63877/156526)
Branch Coverage 35.43% (32125/90660)

@HappenLee
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity cloud ut coverage result:
Function Coverage: 83.00% (1089/1312)
Line Coverage: 66.05% (18163/27500)
Region Coverage: 65.51% (8952/13666)
Branch Coverage: 55.38% (4826/8714)
Coverage Report: http://coverage.selectdb-in.cc/coverage/34e671c98060fdfa0f23d0fedbc62a8784ce513d_34e671c98060fdfa0f23d0fedbc62a8784ce513d_cloud/report/index.html

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	26485	5199	5018	5018
q2	2088	293	198	198
q3	10754	1241	702	702
q4	10295	1045	554	554
q5	8748	2441	2340	2340
q6	195	164	132	132
q7	903	737	618	618
q8	9316	1298	1094	1094
q9	6923	5135	5165	5135
q10	6823	2336	1891	1891
q11	483	292	274	274
q12	353	355	214	214
q13	17767	3741	3093	3093
q14	229	226	220	220
q15	534	496	493	493
q16	453	448	415	415
q17	611	870	361	361
q18	7688	7324	7227	7227
q19	1740	969	583	583
q20	341	338	225	225
q21	3909	3443	2439	2439
q22	1021	1000	974	974
Total cold run time: 117659 ms
Total hot run time: 34200 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5220	5150	5105	5105
q2	238	328	234	234
q3	2166	2668	2302	2302
q4	1414	1975	1492	1492
q5	4589	4389	4300	4300
q6	220	170	126	126
q7	1994	1888	1737	1737
q8	2600	2559	2548	2548
q9	7207	7249	7004	7004
q10	2987	3148	2748	2748
q11	567	509	489	489
q12	703	774	599	599
q13	3442	3951	3599	3599
q14	268	284	265	265
q15	515	481	479	479
q16	487	521	459	459
q17	1174	1505	1384	1384
q18	7861	7614	7512	7512
q19	853	860	923	860
q20	1925	1939	1814	1814
q21	5217	4784	4686	4686
q22	1082	1045	973	973
Total cold run time: 52729 ms
Total hot run time: 50715 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 186310 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 34e671c98060fdfa0f23d0fedbc62a8784ce513d, data reload: false

query1	990	497	514	497
query2	6583	1882	1862	1862
query3	6746	217	220	217
query4	26112	23433	23389	23389
query5	4294	633	473	473
query6	317	216	203	203
query7	4642	490	298	298
query8	301	250	253	250
query9	8603	2574	2571	2571
query10	482	322	263	263
query11	15347	15036	15345	15036
query12	169	109	109	109
query13	1650	514	387	387
query14	9594	6055	6214	6055
query15	211	185	171	171
query16	7491	640	485	485
query17	1168	702	546	546
query18	1989	405	304	304
query19	184	186	152	152
query20	122	120	118	118
query21	208	124	107	107
query22	4281	4128	4084	4084
query23	34101	33058	32978	32978
query24	8545	2392	2382	2382
query25	557	486	405	405
query26	1243	274	152	152
query27	2752	498	333	333
query28	4314	2094	2087	2087
query29	746	595	458	458
query30	285	221	196	196
query31	946	853	731	731
query32	77	72	68	68
query33	582	429	311	311
query34	793	869	504	504
query35	764	804	743	743
query36	944	1003	879	879
query37	109	99	76	76
query38	4156	4111	4184	4111
query39	1425	1543	1405	1405
query40	209	116	104	104
query41	56	51	52	51
query42	121	106	106	106
query43	512	501	477	477
query44	1306	793	793	793
query45	183	174	166	166
query46	843	1019	626	626
query47	1778	1793	1745	1745
query48	366	408	294	294
query49	779	521	410	410
query50	638	678	403	403
query51	4068	4128	4095	4095
query52	104	110	102	102
query53	226	261	182	182
query54	565	568	492	492
query55	85	81	82	81
query56	307	294	276	276
query57	1165	1155	1078	1078
query58	262	247	241	241
query59	2595	2633	2637	2633
query60	335	313	293	293
query61	132	144	127	127
query62	785	696	660	660
query63	219	184	189	184
query64	4287	1000	664	664
query65	4323	4267	4253	4253
query66	1087	421	315	315
query67	16099	15614	15284	15284
query68	8233	885	509	509
query69	463	348	307	307
query70	1203	1131	1136	1131
query71	454	322	298	298
query72	5525	4705	4792	4705
query73	747	625	346	346
query74	8850	9198	8869	8869
query75	3853	3180	2726	2726
query76	3700	1199	773	773
query77	783	438	283	283
query78	10119	10047	9263	9263
query79	1905	805	551	551
query80	603	510	435	435
query81	478	253	223	223
query82	460	126	96	96
query83	258	242	239	239
query84	317	107	87	87
query85	811	344	314	314
query86	337	301	281	281
query87	4480	4444	4437	4437
query88	3364	2229	2209	2209
query89	383	315	285	285
query90	2006	216	211	211
query91	140	139	107	107
query92	77	61	58	58
query93	1176	956	569	569
query94	672	403	303	303
query95	387	292	287	287
query96	488	555	275	275
query97	3183	3208	3149	3149
query98	241	207	207	207
query99	1437	1408	1246	1246
Total cold run time: 274391 ms
Total hot run time: 186310 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.12	0.11	0.10
query3	0.26	0.19	0.20
query4	1.61	0.19	0.20
query5	0.58	0.59	0.54
query6	1.20	0.71	0.73
query7	0.02	0.02	0.02
query8	0.05	0.04	0.04
query9	0.57	0.53	0.53
query10	0.57	0.58	0.56
query11	0.16	0.10	0.11
query12	0.16	0.12	0.12
query13	0.63	0.60	0.60
query14	1.15	1.21	1.24
query15	0.86	0.85	0.85
query16	0.38	0.40	0.38
query17	1.05	1.05	1.01
query18	0.21	0.20	0.20
query19	1.85	1.85	1.82
query20	0.01	0.01	0.01
query21	15.42	0.90	0.53
query22	0.76	1.27	0.66
query23	14.84	1.38	0.60
query24	6.93	0.84	0.84
query25	0.50	0.18	0.07
query26	0.67	0.15	0.14
query27	0.06	0.05	0.06
query28	9.77	0.92	0.42
query29	12.54	4.03	3.35
query30	0.26	0.09	0.07
query31	2.83	0.57	0.38
query32	3.22	0.55	0.46
query33	3.02	3.01	3.04
query34	15.73	5.14	4.52
query35	4.53	4.60	4.52
query36	0.66	0.50	0.49
query37	0.08	0.06	0.07
query38	0.05	0.04	0.04
query39	0.03	0.03	0.03
query40	0.16	0.14	0.13
query41	0.08	0.02	0.02
query42	0.04	0.03	0.02
query43	0.04	0.03	0.03
Total cold run time: 103.7 s
Total hot run time: 29.65 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 48.03% (73/152) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.15% (14422/27135)
Line Coverage 42.01% (125036/297610)
Region Coverage 40.80% (63869/156526)
Branch Coverage 35.44% (32131/90660)

@HappenLee HappenLee changed the title support one rpc send muti blocks [Refactor](Exec) Support one rpc send muti blocks Apr 17, 2025
@HappenLee HappenLee marked this pull request as ready for review April 17, 2025 07:00
@HappenLee
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity cloud ut coverage result:
Function Coverage: 82.98% (1097/1322)
Line Coverage: 65.67% (18315/27891)
Region Coverage: 65.04% (9053/13920)
Branch Coverage: 55.06% (4879/8862)
Coverage Report: http://coverage.selectdb-in.cc/coverage/510980e8478a00f8639193d44255a6c086f65d13_510980e8478a00f8639193d44255a6c086f65d13_cloud/report/index.html

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	26537	5023	5066	5023
q2	2098	281	201	201
q3	10369	1265	712	712
q4	10225	1047	523	523
q5	7546	2427	2407	2407
q6	182	162	134	134
q7	925	744	615	615
q8	9332	1305	1134	1134
q9	6797	5094	5171	5094
q10	6828	2317	1906	1906
q11	491	281	271	271
q12	347	349	220	220
q13	17803	3682	3091	3091
q14	227	236	216	216
q15	532	487	491	487
q16	449	452	400	400
q17	594	862	367	367
q18	7768	7208	7178	7178
q19	1598	974	553	553
q20	339	324	213	213
q21	4119	3409	2473	2473
q22	1067	1008	967	967
Total cold run time: 116173 ms
Total hot run time: 34185 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5179	5092	5127	5092
q2	234	337	226	226
q3	2147	2645	2279	2279
q4	1462	1866	1572	1572
q5	4575	4499	4394	4394
q6	213	164	127	127
q7	2018	1977	1796	1796
q8	2694	2625	2566	2566
q9	7249	7096	7238	7096
q10	3004	3175	2777	2777
q11	593	530	489	489
q12	664	807	633	633
q13	3515	3929	3268	3268
q14	275	307	266	266
q15	532	473	480	473
q16	459	533	480	480
q17	1185	1561	1411	1411
q18	7771	7576	7387	7387
q19	810	767	811	767
q20	1983	2047	1812	1812
q21	5246	4707	4629	4629
q22	1116	1040	995	995
Total cold run time: 52924 ms
Total hot run time: 50535 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 186560 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 510980e8478a00f8639193d44255a6c086f65d13, data reload: false

query1	1021	489	535	489
query2	6568	1808	1736	1736
query3	6761	219	215	215
query4	26210	23306	23532	23306
query5	4398	651	477	477
query6	296	204	202	202
query7	4621	497	291	291
query8	295	271	245	245
query9	8637	2589	2562	2562
query10	492	327	262	262
query11	15755	15371	14845	14845
query12	173	117	115	115
query13	1661	534	394	394
query14	9733	6313	6262	6262
query15	213	204	176	176
query16	7522	661	498	498
query17	1167	722	584	584
query18	2023	393	289	289
query19	184	211	155	155
query20	125	119	117	117
query21	213	121	108	108
query22	3952	4262	4133	4133
query23	33963	32941	32993	32941
query24	8451	2416	2375	2375
query25	534	439	397	397
query26	1235	266	151	151
query27	2754	489	328	328
query28	4350	2105	2083	2083
query29	707	557	423	423
query30	285	219	186	186
query31	977	841	733	733
query32	73	63	65	63
query33	570	368	306	306
query34	783	858	510	510
query35	792	798	738	738
query36	946	1002	897	897
query37	117	99	80	80
query38	4183	4180	4083	4083
query39	1473	1393	1415	1393
query40	210	120	103	103
query41	70	54	56	54
query42	114	104	103	103
query43	508	500	462	462
query44	1301	811	802	802
query45	177	174	177	174
query46	848	1022	626	626
query47	1751	1791	1713	1713
query48	369	405	294	294
query49	772	491	425	425
query50	636	695	399	399
query51	4059	4100	4106	4100
query52	110	108	97	97
query53	226	251	182	182
query54	587	568	497	497
query55	82	78	81	78
query56	293	287	306	287
query57	1155	1160	1076	1076
query58	260	258	268	258
query59	2512	2680	2561	2561
query60	344	345	308	308
query61	154	146	147	146
query62	792	747	658	658
query63	238	190	201	190
query64	4354	1097	809	809
query65	4291	4267	4261	4261
query66	1089	414	315	315
query67	15873	15404	15367	15367
query68	8402	875	507	507
query69	463	316	262	262
query70	1211	1147	1103	1103
query71	463	321	310	310
query72	5705	4787	4989	4787
query73	747	680	350	350
query74	8957	9108	9075	9075
query75	3962	3220	2750	2750
query76	3697	1204	769	769
query77	775	386	288	288
query78	10074	10159	9206	9206
query79	1924	830	560	560
query80	597	538	459	459
query81	489	252	228	228
query82	446	131	99	99
query83	285	258	243	243
query84	295	107	90	90
query85	782	366	350	350
query86	334	310	292	292
query87	4507	4378	4301	4301
query88	2949	2248	2257	2248
query89	384	312	284	284
query90	1952	224	222	222
query91	135	149	109	109
query92	72	61	60	60
query93	1107	963	576	576
query94	677	425	310	310
query95	386	293	284	284
query96	509	600	295	295
query97	3181	3233	3137	3137
query98	234	206	205	205
query99	1427	1403	1308	1308
Total cold run time: 274516 ms
Total hot run time: 186560 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.11	0.11	0.11
query3	0.25	0.19	0.20
query4	1.60	0.19	0.20
query5	0.60	0.56	0.56
query6	1.16	0.71	0.73
query7	0.02	0.02	0.01
query8	0.04	0.04	0.03
query9	0.58	0.53	0.50
query10	0.57	0.57	0.56
query11	0.16	0.12	0.11
query12	0.15	0.12	0.12
query13	0.62	0.60	0.59
query14	1.17	1.21	1.16
query15	0.88	0.85	0.86
query16	0.39	0.41	0.39
query17	1.04	1.02	1.04
query18	0.20	0.20	0.19
query19	1.95	1.80	1.77
query20	0.01	0.01	0.01
query21	15.39	0.87	0.55
query22	0.76	1.10	0.81
query23	14.82	1.36	0.61
query24	7.50	0.72	1.10
query25	0.48	0.18	0.14
query26	0.69	0.16	0.14
query27	0.05	0.05	0.04
query28	9.28	0.92	0.44
query29	12.55	4.02	3.32
query30	0.26	0.09	0.07
query31	2.82	0.59	0.41
query32	3.23	0.56	0.47
query33	3.08	3.08	3.14
query34	15.78	5.21	4.53
query35	4.53	4.59	4.48
query36	0.66	0.50	0.48
query37	0.09	0.06	0.06
query38	0.04	0.04	0.03
query39	0.03	0.02	0.02
query40	0.17	0.14	0.12
query41	0.08	0.02	0.03
query42	0.04	0.02	0.03
query43	0.04	0.03	0.03
Total cold run time: 103.91 s
Total hot run time: 29.69 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 47.09% (81/172) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.54% (14541/27158)
Line Coverage 42.37% (126122/297680)
Region Coverage 41.18% (64449/156522)
Branch Coverage 35.75% (32400/90628)

@hello-stephen
Copy link
Contributor

BE Regression P0 && UT Coverage Report

Increment line coverage 47.09% (81/172) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage
Line Coverage
Region Coverage
Branch Coverage

@HappenLee
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity cloud ut coverage result:
Function Coverage: 83.06% (1098/1322)
Line Coverage: 65.87% (18377/27900)
Region Coverage: 65.29% (9106/13948)
Branch Coverage: 55.24% (4898/8866)
Coverage Report: http://coverage.selectdb-in.cc/coverage/0555ff58ad5b3456835a19425af89d6b0b9f5e2a_0555ff58ad5b3456835a19425af89d6b0b9f5e2a_cloud/report/index.html

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	26552	5303	5003	5003
q2	2083	287	188	188
q3	10372	1285	723	723
q4	10223	1051	541	541
q5	7558	2482	2331	2331
q6	191	169	133	133
q7	937	760	629	629
q8	9333	1316	1104	1104
q9	6854	5183	5144	5144
q10	6857	2327	1893	1893
q11	493	283	276	276
q12	358	358	219	219
q13	17777	3654	3071	3071
q14	228	230	218	218
q15	526	495	484	484
q16	468	442	406	406
q17	598	878	356	356
q18	7740	7155	7132	7132
q19	1554	982	552	552
q20	337	330	215	215
q21	3972	3413	2428	2428
q22	1074	1029	1013	1013
Total cold run time: 116085 ms
Total hot run time: 34059 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5174	5114	5074	5074
q2	235	323	228	228
q3	2165	2652	2237	2237
q4	1459	1840	1553	1553
q5	4533	4455	4352	4352
q6	217	169	128	128
q7	2006	1922	1743	1743
q8	2614	2565	2575	2565
q9	7254	7343	7203	7203
q10	2970	3161	2791	2791
q11	575	499	477	477
q12	674	750	619	619
q13	3561	3891	3176	3176
q14	288	308	268	268
q15	537	486	480	480
q16	484	499	473	473
q17	1160	1593	1396	1396
q18	7697	7648	7363	7363
q19	804	792	822	792
q20	1971	2046	1898	1898
q21	5267	4696	4512	4512
q22	1078	1020	1015	1015
Total cold run time: 52723 ms
Total hot run time: 50343 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 185536 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 0555ff58ad5b3456835a19425af89d6b0b9f5e2a, data reload: false

query1	1023	473	498	473
query2	6554	1816	1763	1763
query3	6743	225	217	217
query4	25926	23785	23351	23351
query5	4335	616	487	487
query6	339	217	186	186
query7	4619	476	277	277
query8	288	230	229	229
query9	8609	2585	2591	2585
query10	477	318	263	263
query11	15133	15013	14883	14883
query12	167	106	101	101
query13	1643	514	376	376
query14	8725	6236	6143	6143
query15	193	201	172	172
query16	7164	652	517	517
query17	1062	758	571	571
query18	1980	409	315	315
query19	194	181	165	165
query20	119	123	122	122
query21	218	125	109	109
query22	4184	4208	4110	4110
query23	33925	33075	33109	33075
query24	8467	2403	2386	2386
query25	551	486	412	412
query26	1252	269	156	156
query27	2749	499	323	323
query28	4337	2095	2078	2078
query29	773	546	446	446
query30	288	216	186	186
query31	938	857	754	754
query32	74	68	62	62
query33	576	385	310	310
query34	793	903	524	524
query35	763	796	804	796
query36	942	976	887	887
query37	110	101	76	76
query38	4176	4147	4098	4098
query39	1466	1448	1402	1402
query40	209	117	101	101
query41	60	55	53	53
query42	119	108	104	104
query43	495	506	483	483
query44	1317	804	780	780
query45	178	169	161	161
query46	812	1014	612	612
query47	1724	1800	1754	1754
query48	372	406	308	308
query49	769	511	407	407
query50	640	679	391	391
query51	4208	4065	4035	4035
query52	112	102	99	99
query53	220	241	186	186
query54	581	575	497	497
query55	85	78	80	78
query56	302	298	290	290
query57	1123	1161	1082	1082
query58	258	258	253	253
query59	2461	2643	2464	2464
query60	331	330	286	286
query61	127	159	131	131
query62	779	738	673	673
query63	240	197	191	191
query64	4411	1022	671	671
query65	4310	4181	4196	4181
query66	1135	413	314	314
query67	15517	15541	15201	15201
query68	7906	888	516	516
query69	461	301	262	262
query70	1189	1053	1058	1053
query71	447	308	285	285
query72	5622	4729	4802	4729
query73	697	632	349	349
query74	8849	9243	8630	8630
query75	3793	3165	2709	2709
query76	3634	1177	726	726
query77	802	380	296	296
query78	9932	10095	9305	9305
query79	2019	815	577	577
query80	692	509	451	451
query81	495	258	217	217
query82	443	125	96	96
query83	247	248	236	236
query84	285	106	89	89
query85	795	348	388	348
query86	387	322	271	271
query87	4548	4517	4354	4354
query88	3514	2202	2201	2201
query89	382	316	275	275
query90	1901	213	208	208
query91	141	146	113	113
query92	79	56	60	56
query93	1680	923	578	578
query94	658	406	303	303
query95	379	293	286	286
query96	481	569	271	271
query97	3157	3215	3105	3105
query98	235	202	211	202
query99	1420	1398	1267	1267
Total cold run time: 272040 ms
Total hot run time: 185536 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.12	0.10	0.12
query3	0.25	0.19	0.19
query4	1.60	0.19	0.11
query5	0.57	0.56	0.53
query6	1.19	0.72	0.71
query7	0.02	0.02	0.02
query8	0.05	0.04	0.03
query9	0.57	0.52	0.51
query10	0.57	0.56	0.57
query11	0.15	0.11	0.11
query12	0.15	0.11	0.11
query13	0.62	0.59	0.60
query14	1.18	1.21	1.19
query15	0.86	0.86	0.87
query16	0.38	0.38	0.39
query17	1.03	1.02	1.04
query18	0.21	0.20	0.19
query19	1.89	1.76	1.78
query20	0.01	0.01	0.01
query21	15.43	0.89	0.57
query22	0.73	1.16	0.72
query23	14.86	1.40	0.67
query24	6.81	2.02	0.99
query25	0.51	0.07	0.16
query26	0.64	0.17	0.15
query27	0.05	0.05	0.05
query28	9.30	0.87	0.43
query29	12.56	4.09	3.36
query30	0.25	0.10	0.07
query31	2.82	0.59	0.39
query32	3.23	0.55	0.48
query33	2.97	3.11	3.04
query34	15.75	5.13	4.51
query35	4.57	4.53	4.53
query36	0.66	0.51	0.48
query37	0.09	0.06	0.06
query38	0.05	0.04	0.03
query39	0.03	0.02	0.02
query40	0.17	0.14	0.13
query41	0.08	0.03	0.02
query42	0.03	0.03	0.02
query43	0.04	0.03	0.02
Total cold run time: 103.09 s
Total hot run time: 29.82 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 47.09% (81/172) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.59% (14548/27147)
Line Coverage 42.45% (126364/297708)
Region Coverage 41.23% (64546/156549)
Branch Coverage 35.83% (32483/90650)

@HappenLee HappenLee force-pushed the opt_rpc branch 2 times, most recently from 8c350b9 to 0166d9a Compare April 28, 2025 08:49
@HappenLee
Copy link
Contributor Author

run buildall

@HappenLee
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity cloud ut coverage result:
Function Coverage: 83.06% (1098/1322)
Line Coverage: 65.90% (18393/27909)
Region Coverage: 65.32% (9115/13954)
Branch Coverage: 55.33% (4908/8870)
Coverage Report: http://coverage.selectdb-in.cc/coverage/9dd7eb79da2ec326feacad5d62559a520cff770e_9dd7eb79da2ec326feacad5d62559a520cff770e_cloud/report/index.html

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	26377	5202	4989	4989
q2	2081	280	191	191
q3	10384	1275	701	701
q4	10228	1034	546	546
q5	7539	2429	2344	2344
q6	193	161	135	135
q7	938	767	597	597
q8	9306	1303	1168	1168
q9	6864	5080	5114	5080
q10	6798	2309	1903	1903
q11	468	299	268	268
q12	350	349	221	221
q13	17800	3669	3093	3093
q14	230	227	211	211
q15	533	488	481	481
q16	422	431	362	362
q17	598	874	360	360
q18	7508	7237	7206	7206
q19	1160	957	561	561
q20	345	341	226	226
q21	3947	3428	2479	2479
q22	1039	1002	975	975
Total cold run time: 115108 ms
Total hot run time: 34097 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5149	5047	5072	5047
q2	243	334	228	228
q3	2121	2698	2287	2287
q4	1366	1807	1350	1350
q5	4490	4419	4460	4419
q6	218	177	123	123
q7	2050	1945	1778	1778
q8	2643	2561	2518	2518
q9	7331	7324	7102	7102
q10	3014	3196	2757	2757
q11	607	525	505	505
q12	684	778	612	612
q13	3503	3898	3365	3365
q14	312	303	264	264
q15	514	472	491	472
q16	427	480	423	423
q17	1164	1518	1472	1472
q18	7817	7620	7342	7342
q19	795	811	893	811
q20	2015	2005	1829	1829
q21	5114	4678	4738	4678
q22	1119	1094	993	993
Total cold run time: 52696 ms
Total hot run time: 50375 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 192406 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 9dd7eb79da2ec326feacad5d62559a520cff770e, data reload: false

query1	1431	1099	1084	1084
query2	6045	1858	1823	1823
query3	11007	4612	4524	4524
query4	53356	25311	22978	22978
query5	5252	547	464	464
query6	331	195	209	195
query7	4984	494	284	284
query8	327	254	242	242
query9	5705	2587	2587	2587
query10	442	332	269	269
query11	15081	15047	14827	14827
query12	164	120	104	104
query13	1099	518	398	398
query14	10333	6460	6540	6460
query15	198	198	185	185
query16	7154	671	505	505
query17	1093	742	622	622
query18	1598	434	333	333
query19	205	191	192	191
query20	140	139	131	131
query21	200	126	108	108
query22	4439	4513	4212	4212
query23	34119	33491	33446	33446
query24	6712	2478	2420	2420
query25	491	493	415	415
query26	757	268	148	148
query27	2551	508	332	332
query28	3029	2143	2142	2142
query29	582	582	438	438
query30	276	241	197	197
query31	849	858	789	789
query32	72	67	66	66
query33	463	367	304	304
query34	787	876	539	539
query35	798	835	749	749
query36	928	988	913	913
query37	121	109	80	80
query38	4182	4321	4206	4206
query39	1521	1447	1462	1447
query40	208	118	110	110
query41	55	53	54	53
query42	125	111	106	106
query43	495	506	465	465
query44	1340	810	820	810
query45	181	174	166	166
query46	847	1033	633	633
query47	1898	1879	1767	1767
query48	383	433	306	306
query49	775	537	420	420
query50	670	729	406	406
query51	4210	4216	4152	4152
query52	114	109	103	103
query53	240	252	207	207
query54	605	596	529	529
query55	87	82	84	82
query56	309	318	301	301
query57	1182	1209	1120	1120
query58	252	246	249	246
query59	2615	2649	2535	2535
query60	318	315	317	315
query61	134	127	131	127
query62	719	730	658	658
query63	234	186	189	186
query64	2192	1040	689	689
query65	4275	4257	4192	4192
query66	770	395	304	304
query67	15924	15591	15248	15248
query68	7363	899	513	513
query69	543	324	331	324
query70	1214	1127	1117	1117
query71	498	324	297	297
query72	5725	4852	4954	4852
query73	1220	671	341	341
query74	8977	9193	8919	8919
query75	3913	3225	2711	2711
query76	4149	1195	761	761
query77	640	381	290	290
query78	10113	10058	9336	9336
query79	2619	799	564	564
query80	716	519	448	448
query81	500	250	228	228
query82	441	127	97	97
query83	301	248	235	235
query84	300	120	85	85
query85	772	380	326	326
query86	379	312	312	312
query87	4342	4518	4356	4356
query88	3528	2210	2203	2203
query89	402	333	283	283
query90	1804	217	214	214
query91	147	145	112	112
query92	69	59	56	56
query93	2043	945	580	580
query94	662	420	309	309
query95	369	293	286	286
query96	477	564	274	274
query97	3175	3241	3093	3093
query98	226	211	223	211
query99	1422	1411	1280	1280
Total cold run time: 299028 ms
Total hot run time: 192406 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.15	0.11	0.12
query3	0.34	0.21	0.21
query4	1.59	0.21	0.20
query5	0.61	0.61	0.60
query6	1.19	0.72	0.71
query7	0.02	0.02	0.02
query8	0.05	0.05	0.05
query9	0.63	0.51	0.52
query10	0.58	0.58	0.57
query11	0.26	0.13	0.13
query12	0.25	0.13	0.14
query13	0.63	0.62	0.61
query14	0.80	0.80	0.83
query15	0.95	0.87	0.86
query16	0.36	0.37	0.38
query17	1.01	1.00	1.02
query18	0.22	0.21	0.22
query19	1.90	1.82	1.84
query20	0.02	0.02	0.01
query21	15.46	1.02	0.68
query22	0.93	1.01	0.77
query23	14.74	1.57	0.75
query24	5.48	0.58	0.28
query25	0.18	0.09	0.09
query26	0.55	0.22	0.18
query27	0.09	0.09	0.09
query28	11.03	1.16	0.56
query29	12.55	4.13	3.42
query30	0.28	0.08	0.06
query31	2.81	0.61	0.42
query32	3.23	0.60	0.50
query33	3.07	3.03	3.06
query34	16.29	5.10	4.42
query35	4.49	4.42	4.48
query36	0.65	0.49	0.51
query37	0.20	0.17	0.18
query38	0.18	0.15	0.15
query39	0.05	0.04	0.04
query40	0.20	0.16	0.15
query41	0.10	0.05	0.05
query42	0.06	0.05	0.06
query43	0.06	0.05	0.04
Total cold run time: 104.28 s
Total hot run time: 29.76 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 47.09% (81/172) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 54.67% (14741/26962)
Line Coverage 43.74% (129135/295200)
Region Coverage 42.47% (65930/155234)
Branch Coverage 37.04% (33231/89718)

@hello-stephen
Copy link
Contributor

BE Regression P0 && UT Coverage Report

Increment line coverage 91.86% (158/172) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 78.04% (20653/26466)
Line Coverage 71.62% (211077/294716)
Region Coverage 69.79% (126772/181656)
Branch Coverage 63.06% (64499/102280)

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Apr 29, 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.

@HappenLee HappenLee merged commit e41ffc7 into apache:master Apr 29, 2025
24 of 26 checks passed
BiteTheDDDDt pushed a commit that referenced this pull request Apr 30, 2025
### What problem does this PR solve?

#50113

transmit_block should be marked as done when transmitting the last
block.
Otherwise, the previous block might reach a memory limit and set done to
null.

```
F20250430 11:49:29.413803 2176884 vdata_stream_recvr.cpp:200] Check failed: *done != nullptr 
*** Check failure stack trace: ***
    @     0x558196be1956  google::LogMessage::SendToLog()
    @     0x558196bde3a0  google::LogMessage::Flush()
    @     0x558196be2199  google::LogMessageFatal::~LogMessageFatal()
    @     0x558193b1659c  doris::vectorized::VDataStreamRecvr::SenderQueue::add_block()
    @     0x558193b1f7b5  doris::vectorized::VDataStreamRecvr::add_block()
    @     0x558193af6cf8  doris::vectorized::VDataStreamMgr::transmit_block()
    @     0x558157f7a685  doris::pipeline::DataStreamRecvrTest_transmit_block_Test::TestBody()
    @     0x5581973c8c0b  testing::internal::HandleSehExceptionsInMethodIfSupported<>()
    @     0x5581973c2a69  testing::internal::HandleExceptionsInMethodIfSupported<>()
    @     0x55819739943a  testing::Test::Run()
    @     0x558197399e5e  testing::TestInfo::Run()
    @     0x55819739a71e  testing::TestSuite::Run()
    @     0x5581973a9dde  testing::internal::UnitTestImpl::RunAllTests()
    @     0x5581973c9a56  testing::internal::HandleSehExceptionsInMethodIfSupported<>()
    @     0x5581973c3a61  testing::internal::HandleExceptionsInMethodIfSupported<>()
    @     0x5581973a85d3  testing::UnitTest::Run()
    @     0x5581593d8653  RUN_ALL_TESTS()
```
### Release note

None

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [x] 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 <!-- Add your reason?  -->

- Behavior changed:
    - [x] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
1. Rmove unless channel ptr in trans struct to reduce mem consume
2. Send multi block one time in one rpc
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
…#50560)

### What problem does this PR solve?

apache#50113

transmit_block should be marked as done when transmitting the last
block.
Otherwise, the previous block might reach a memory limit and set done to
null.

```
F20250430 11:49:29.413803 2176884 vdata_stream_recvr.cpp:200] Check failed: *done != nullptr 
*** Check failure stack trace: ***
    @     0x558196be1956  google::LogMessage::SendToLog()
    @     0x558196bde3a0  google::LogMessage::Flush()
    @     0x558196be2199  google::LogMessageFatal::~LogMessageFatal()
    @     0x558193b1659c  doris::vectorized::VDataStreamRecvr::SenderQueue::add_block()
    @     0x558193b1f7b5  doris::vectorized::VDataStreamRecvr::add_block()
    @     0x558193af6cf8  doris::vectorized::VDataStreamMgr::transmit_block()
    @     0x558157f7a685  doris::pipeline::DataStreamRecvrTest_transmit_block_Test::TestBody()
    @     0x5581973c8c0b  testing::internal::HandleSehExceptionsInMethodIfSupported<>()
    @     0x5581973c2a69  testing::internal::HandleExceptionsInMethodIfSupported<>()
    @     0x55819739943a  testing::Test::Run()
    @     0x558197399e5e  testing::TestInfo::Run()
    @     0x55819739a71e  testing::TestSuite::Run()
    @     0x5581973a9dde  testing::internal::UnitTestImpl::RunAllTests()
    @     0x5581973c9a56  testing::internal::HandleSehExceptionsInMethodIfSupported<>()
    @     0x5581973c3a61  testing::internal::HandleExceptionsInMethodIfSupported<>()
    @     0x5581973a85d3  testing::UnitTest::Run()
    @     0x5581593d8653  RUN_ALL_TESTS()
```
### Release note

None

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [x] 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 <!-- Add your reason?  -->

- Behavior changed:
    - [x] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
Gabriel39 pushed a commit that referenced this pull request Nov 17, 2025
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
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.

5 participants