Skip to content

[fix](storage) Fix linker error for SegmentWriter::_is_mow() with -O1/-O3#63928

Merged
yiguolei merged 1 commit into
apache:masterfrom
heguanhui:fix/segment-writer-inline-linker-error
Jun 9, 2026
Merged

[fix](storage) Fix linker error for SegmentWriter::_is_mow() with -O1/-O3#63928
yiguolei merged 1 commit into
apache:masterfrom
heguanhui:fix/segment-writer-inline-linker-error

Conversation

@heguanhui

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #63927

Problem Summary: Building BE unit tests with TSAN (-O1) or RELEASE (-O3) causes undefined reference linker errors for SegmentWriter::_is_mow(), SegmentWriter::_is_mow_with_cluster_key(), and their VerticalSegmentWriter counterparts.

Root cause: Commit 74aa0ca63a defined these methods with the inline keyword in .cpp files (segment_writer.cpp and vertical_segment_writer.cpp). At -O0 (ASAN), the compiler ignores inline and exports the symbol, so linking succeeds. At -O1/-O3, the compiler inlines the function and does NOT export the symbol. When commit 4616202fc4 introduced TestSegmentWriter (a friend subclass) in test_segment_writer.h that calls these private methods from a different translation unit, the linker cannot find the symbols.

Fix: Move the inline definitions from .cpp files into the header files as class-internal inline definitions, so they are visible to all translation units.

Error example (TSAN build):

undefined reference to 'doris::segment_v2::SegmentWriter::_is_mow()'
undefined reference to 'doris::segment_v2::SegmentWriter::_is_mow_with_cluster_key()'
undefined reference to 'doris::segment_v2::VerticalSegmentWriter::_is_mow()'
undefined reference to 'doris::segment_v2::VerticalSegmentWriter::_is_mow_with_cluster_key()'

Release note

None

Check List (For Author)

  • Test

    • Unit Test: Added segment_writer_mow_check_test.cpp with 7 test cases covering all logic branches for both SegmentWriter and VerticalSegmentWriter
    • Regression 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
Copy Markdown
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?

@heguanhui

Copy link
Copy Markdown
Contributor Author

run buildall

@heguanhui heguanhui force-pushed the fix/segment-writer-inline-linker-error branch from 690328a to 804c31c Compare June 1, 2026 02:55
yiguolei
yiguolei previously approved these changes Jun 1, 2026
@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jun 1, 2026
liaoxin01
liaoxin01 previously approved these changes Jun 1, 2026

@liaoxin01 liaoxin01 left a comment

Copy link
Copy Markdown
Contributor

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 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@yiguolei

yiguolei commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 29263 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 804c31c287c7be13d9d91d912298219ce79c06f3, data reload: false

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17648	4003	4172	4003
q2	q3	10747	1451	800	800
q4	4692	479	353	353
q5	7537	952	592	592
q6	184	177	137	137
q7	786	878	649	649
q8	9420	1571	1505	1505
q9	5862	4548	4525	4525
q10	6797	1825	1566	1566
q11	447	277	250	250
q12	629	424	291	291
q13	18099	3400	2770	2770
q14	268	261	237	237
q15	q16	823	775	704	704
q17	973	957	1033	957
q18	7126	5964	5499	5499
q19	1311	1241	1011	1011
q20	514	408	263	263
q21	6564	2844	2825	2825
q22	476	376	326	326
Total cold run time: 100903 ms
Total hot run time: 29263 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	5113	4715	4852	4715
q2	q3	5090	5261	4745	4745
q4	2109	2214	1392	1392
q5	4794	4909	4672	4672
q6	246	186	136	136
q7	1826	1764	1694	1694
q8	2450	2104	2101	2101
q9	8049	7947	7341	7341
q10	4940	4701	4222	4222
q11	545	384	352	352
q12	731	736	538	538
q13	3019	3393	2788	2788
q14	272	302	251	251
q15	q16	681	703	612	612
q17	1294	1264	1266	1264
q18	7250	6963	7003	6963
q19	1149	1163	1128	1128
q20	2223	2218	1938	1938
q21	5329	4663	4598	4598
q22	506	450	396	396
Total cold run time: 57616 ms
Total hot run time: 51846 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 170825 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 804c31c287c7be13d9d91d912298219ce79c06f3, data reload: false

query5	4324	669	524	524
query6	334	229	202	202
query7	4312	554	322	322
query8	337	228	225	225
query9	8816	4118	4104	4104
query10	448	347	302	302
query11	5798	2431	2215	2215
query12	190	136	130	130
query13	1274	620	412	412
query14	6056	5463	5169	5169
query14_1	4477	4484	4467	4467
query15	213	205	185	185
query16	1006	455	450	450
query17	1000	756	628	628
query18	2471	513	374	374
query19	235	224	183	183
query20	149	151	143	143
query21	224	150	121	121
query22	13627	13776	13483	13483
query23	17336	16680	16280	16280
query23_1	16442	16314	16305	16305
query24	7550	1765	1320	1320
query24_1	1342	1292	1336	1292
query25	598	523	474	474
query26	1322	329	178	178
query27	2701	559	342	342
query28	4389	2045	2026	2026
query29	1046	678	562	562
query30	310	234	202	202
query31	1133	1093	966	966
query32	96	80	81	80
query33	571	361	320	320
query34	1200	1140	672	672
query35	810	805	699	699
query36	1387	1428	1273	1273
query37	158	107	90	90
query38	3224	3149	3078	3078
query39	931	915	891	891
query39_1	906	900	864	864
query40	230	151	127	127
query41	65	62	62	62
query42	112	119	114	114
query43	333	333	298	298
query44	
query45	216	206	197	197
query46	1100	1164	735	735
query47	2333	2336	2231	2231
query48	399	424	313	313
query49	631	480	389	389
query50	1008	354	265	265
query51	4329	4313	4267	4267
query52	108	111	103	103
query53	254	293	210	210
query54	334	272	257	257
query55	95	98	87	87
query56	312	314	311	311
query57	1449	1411	1309	1309
query58	314	277	285	277
query59	1579	1687	1419	1419
query60	327	338	318	318
query61	167	161	160	160
query62	694	650	587	587
query63	252	207	214	207
query64	2502	786	663	663
query65	
query66	1755	487	387	387
query67	29772	29107	29618	29107
query68	
query69	494	335	295	295
query70	1058	1026	991	991
query71	308	284	275	275
query72	3050	2812	2466	2466
query73	875	809	425	425
query74	5106	4942	4750	4750
query75	2703	2600	2277	2277
query76	2301	1142	801	801
query77	401	425	345	345
query78	12492	12500	11981	11981
query79	1442	1036	791	791
query80	651	541	458	458
query81	465	284	244	244
query82	1372	158	124	124
query83	357	277	250	250
query84	310	147	110	110
query85	879	575	484	484
query86	388	337	333	333
query87	3455	3380	3269	3269
query88	3636	2775	2756	2756
query89	449	396	355	355
query90	1967	189	187	187
query91	178	167	144	144
query92	79	80	77	77
query93	1493	1456	836	836
query94	567	364	277	277
query95	697	377	348	348
query96	1033	789	364	364
query97	2753	2710	2614	2614
query98	242	232	227	227
query99	1184	1168	1029	1029
Total cold run time: 254783 ms
Total hot run time: 170825 ms

@heguanhui heguanhui dismissed stale reviews from liaoxin01 and yiguolei via 04717d8 June 1, 2026 15:45
@heguanhui heguanhui force-pushed the fix/segment-writer-inline-linker-error branch from 804c31c to 04717d8 Compare June 1, 2026 15:45
@github-actions github-actions Bot removed the approved Indicates a PR has been approved by one committer. label Jun 1, 2026
@heguanhui

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 28727 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 04717d8b02ff0cfb126248032622a71e774eed29, data reload: false

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17824	4170	4226	4170
q2	q3	10732	1376	840	840
q4	4696	474	349	349
q5	7559	886	582	582
q6	192	177	138	138
q7	811	820	641	641
q8	9925	1592	1724	1592
q9	7009	4470	4523	4470
q10	6816	1808	1505	1505
q11	438	278	248	248
q12	643	428	294	294
q13	18153	3379	2725	2725
q14	277	262	236	236
q15	q16	822	770	704	704
q17	1317	1023	870	870
q18	6927	5658	5437	5437
q19	1562	1356	1091	1091
q20	527	395	267	267
q21	6013	2656	2270	2270
q22	425	351	298	298
Total cold run time: 102668 ms
Total hot run time: 28727 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4489	4311	4469	4311
q2	q3	4542	4973	4357	4357
q4	2099	2193	1382	1382
q5	4365	4271	4331	4271
q6	232	174	132	132
q7	2015	1957	1674	1674
q8	2495	2132	2069	2069
q9	8028	8099	7977	7977
q10	4803	4823	4364	4364
q11	564	419	546	419
q12	748	752	545	545
q13	3282	3665	3011	3011
q14	306	324	286	286
q15	q16	757	740	667	667
q17	1367	1330	1358	1330
q18	7860	7368	6834	6834
q19	1111	1070	1088	1070
q20	2223	2231	1936	1936
q21	5252	4556	4439	4439
q22	535	456	401	401
Total cold run time: 57073 ms
Total hot run time: 51475 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 170738 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 04717d8b02ff0cfb126248032622a71e774eed29, data reload: false

query5	4306	661	527	527
query6	378	227	214	214
query7	4261	569	302	302
query8	332	233	222	222
query9	8805	4028	4094	4028
query10	470	350	315	315
query11	5832	2375	2205	2205
query12	187	138	134	134
query13	1275	636	459	459
query14	6156	5476	5184	5184
query14_1	4499	4508	4478	4478
query15	220	211	188	188
query16	999	461	432	432
query17	1154	738	624	624
query18	2734	502	371	371
query19	236	209	169	169
query20	145	140	136	136
query21	219	143	116	116
query22	13710	13563	13417	13417
query23	17329	16551	16265	16265
query23_1	16251	16208	16309	16208
query24	7691	1762	1307	1307
query24_1	1321	1296	1339	1296
query25	607	529	461	461
query26	1320	316	184	184
query27	2653	581	337	337
query28	4468	2045	2078	2045
query29	1017	671	541	541
query30	316	235	199	199
query31	1161	1078	968	968
query32	94	80	78	78
query33	564	376	308	308
query34	1186	1172	665	665
query35	770	807	752	752
query36	1345	1429	1231	1231
query37	154	103	91	91
query38	3260	3199	3083	3083
query39	925	911	912	911
query39_1	885	883	868	868
query40	236	153	133	133
query41	66	64	61	61
query42	114	113	116	113
query43	337	341	291	291
query44	
query45	218	208	202	202
query46	1111	1196	735	735
query47	2340	2360	2225	2225
query48	411	400	302	302
query49	632	494	392	392
query50	982	350	252	252
query51	4332	4397	4321	4321
query52	108	112	103	103
query53	273	300	216	216
query54	322	281	262	262
query55	94	93	86	86
query56	306	318	303	303
query57	1410	1417	1286	1286
query58	312	281	278	278
query59	1554	1686	1377	1377
query60	325	336	314	314
query61	166	153	153	153
query62	706	653	589	589
query63	259	218	207	207
query64	2354	799	619	619
query65	
query66	1676	467	360	360
query67	29798	29692	28944	28944
query68	
query69	464	342	348	342
query70	1089	1078	1062	1062
query71	307	290	273	273
query72	3030	2707	2440	2440
query73	863	777	445	445
query74	5132	4947	4762	4762
query75	2728	2622	2260	2260
query76	2276	1182	811	811
query77	411	437	348	348
query78	12391	12526	11804	11804
query79	1498	1024	749	749
query80	888	550	479	479
query81	488	279	244	244
query82	1370	161	121	121
query83	357	274	251	251
query84	260	140	111	111
query85	923	545	463	463
query86	449	371	337	337
query87	3448	3378	3244	3244
query88	3703	2791	2782	2782
query89	458	394	357	357
query90	1876	190	185	185
query91	177	169	138	138
query92	82	83	78	78
query93	1582	1572	955	955
query94	598	355	319	319
query95	675	493	352	352
query96	1105	861	365	365
query97	2735	2725	2603	2603
query98	240	249	236	236
query99	1151	1176	1025	1025
Total cold run time: 255394 ms
Total hot run time: 170738 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 74.58% (28427/38114)
Line Coverage 58.74% (310755/529057)
Region Coverage 56.48% (263036/465681)
Branch Coverage 57.83% (113179/195715)

@heguanhui heguanhui requested review from liaoxin01 and yiguolei June 2, 2026 02:12
@heguanhui

Copy link
Copy Markdown
Contributor Author

run buildall

@heguanhui

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 29389 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 04717d8b02ff0cfb126248032622a71e774eed29, data reload: false

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17662	4095	4021	4021
q2	q3	10770	1400	828	828
q4	4686	482	364	364
q5	7564	869	582	582
q6	190	179	139	139
q7	781	856	634	634
q8	9403	1550	1627	1550
q9	5948	4525	4548	4525
q10	6750	1796	1568	1568
q11	445	281	261	261
q12	637	435	287	287
q13	18114	3446	2824	2824
q14	263	259	252	252
q15	q16	822	783	710	710
q17	1008	968	924	924
q18	7110	5856	5520	5520
q19	1306	1324	1091	1091
q20	505	402	263	263
q21	6210	2889	2734	2734
q22	460	397	312	312
Total cold run time: 100634 ms
Total hot run time: 29389 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	5036	4639	4765	4639
q2	q3	4911	5257	4737	4737
q4	2124	2194	1425	1425
q5	4891	4639	4912	4639
q6	235	179	130	130
q7	1806	1726	1613	1613
q8	2412	2130	2051	2051
q9	7911	7904	7355	7355
q10	4776	4705	4223	4223
q11	530	380	352	352
q12	733	734	532	532
q13	2986	3376	2867	2867
q14	272	276	247	247
q15	q16	676	701	613	613
q17	1276	1255	1247	1247
q18	7234	6785	6751	6751
q19	1177	1125	1098	1098
q20	2221	2228	1944	1944
q21	5299	4607	4474	4474
q22	527	464	406	406
Total cold run time: 57033 ms
Total hot run time: 51343 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 169461 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 04717d8b02ff0cfb126248032622a71e774eed29, data reload: false

query5	4368	644	483	483
query6	444	204	185	185
query7	4834	546	304	304
query8	376	217	207	207
query9	8790	4086	4059	4059
query10	490	310	266	266
query11	5750	2364	2181	2181
query12	179	115	105	105
query13	1271	609	387	387
query14	6415	5369	5025	5025
query14_1	4371	4400	4384	4384
query15	207	198	167	167
query16	1018	448	428	428
query17	1091	694	578	578
query18	2426	469	335	335
query19	192	183	137	137
query20	111	107	105	105
query21	216	141	114	114
query22	13716	13655	13452	13452
query23	17408	16504	16144	16144
query23_1	16278	16221	16452	16221
query24	7478	1784	1311	1311
query24_1	1326	1298	1319	1298
query25	581	468	399	399
query26	1319	324	168	168
query27	2712	580	343	343
query28	4533	2016	2022	2016
query29	1095	641	513	513
query30	313	244	199	199
query31	1105	1079	954	954
query32	110	67	61	61
query33	540	324	255	255
query34	1160	1117	651	651
query35	759	803	688	688
query36	1416	1377	1242	1242
query37	158	110	94	94
query38	3227	3085	3055	3055
query39	939	920	893	893
query39_1	879	877	894	877
query40	236	129	107	107
query41	74	72	67	67
query42	100	96	96	96
query43	314	323	282	282
query44	
query45	197	187	180	180
query46	1109	1276	747	747
query47	2379	2377	2275	2275
query48	395	405	310	310
query49	648	476	377	377
query50	946	347	261	261
query51	4376	4292	4283	4283
query52	91	91	80	80
query53	246	274	198	198
query54	292	253	210	210
query55	87	79	72	72
query56	245	255	243	243
query57	1433	1422	1328	1328
query58	251	223	234	223
query59	1610	1676	1445	1445
query60	298	262	251	251
query61	183	197	160	160
query62	691	684	579	579
query63	232	182	181	181
query64	2598	798	628	628
query65	
query66	1794	479	337	337
query67	29798	29863	29598	29598
query68	
query69	421	304	271	271
query70	932	971	899	899
query71	292	231	210	210
query72	3043	2669	2381	2381
query73	858	788	429	429
query74	5098	4961	4786	4786
query75	2693	2605	2252	2252
query76	2309	1141	804	804
query77	366	357	288	288
query78	12328	12419	11943	11943
query79	1435	1075	760	760
query80	1281	506	389	389
query81	496	280	247	247
query82	579	157	123	123
query83	354	281	248	248
query84	268	138	111	111
query85	922	516	442	442
query86	410	304	299	299
query87	3383	3363	3239	3239
query88	3611	2748	2766	2748
query89	441	373	328	328
query90	1814	186	172	172
query91	176	165	148	148
query92	65	58	56	56
query93	1537	1462	887	887
query94	673	341	321	321
query95	721	382	439	382
query96	1015	877	353	353
query97	2678	2686	2534	2534
query98	212	208	200	200
query99	1168	1173	1030	1030
Total cold run time: 252330 ms
Total hot run time: 169461 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 54.14% (21130/39025)
Line Coverage 37.69% (200746/532642)
Region Coverage 33.83% (158098/467310)
Branch Coverage 34.78% (68985/198368)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 74.47% (28457/38212)
Line Coverage 58.46% (310435/531031)
Region Coverage 55.86% (263274/471310)
Branch Coverage 57.05% (113532/199003)

1 similar comment
@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 74.47% (28457/38212)
Line Coverage 58.46% (310435/531031)
Region Coverage 55.86% (263274/471310)
Branch Coverage 57.05% (113532/199003)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 74.53% (28481/38215)
Line Coverage 58.60% (311313/531266)
Region Coverage 56.00% (264152/471731)
Branch Coverage 57.23% (113947/199114)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.86% (28227/38215)
Line Coverage 57.80% (307049/531266)
Region Coverage 54.71% (258064/471731)
Branch Coverage 56.03% (111556/199114)

@heguanhui heguanhui force-pushed the fix/segment-writer-inline-linker-error branch 2 times, most recently from 1c35ec3 to 96f1ab1 Compare June 6, 2026 18:21
@heguanhui

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 28971 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 96f1ab107627b730c665d302d3567e246d99589c, data reload: false

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17749	4006	4006	4006
q2	q3	10777	1359	822	822
q4	4707	488	348	348
q5	7644	868	593	593
q6	201	174	138	138
q7	806	866	631	631
q8	10296	1569	1577	1569
q9	6552	4508	4466	4466
q10	6772	1834	1504	1504
q11	434	275	247	247
q12	656	430	288	288
q13	18162	3372	2790	2790
q14	281	261	242	242
q15	q16	821	779	710	710
q17	2045	1021	956	956
q18	7303	5770	5532	5532
q19	1966	1309	1100	1100
q20	524	407	272	272
q21	5872	2571	2456	2456
q22	429	357	301	301
Total cold run time: 103997 ms
Total hot run time: 28971 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4434	4315	4312	4312
q2	q3	4519	4946	4363	4363
q4	2067	2200	1347	1347
q5	4402	4294	4284	4284
q6	225	176	129	129
q7	2233	1888	1724	1724
q8	2516	2077	2066	2066
q9	7958	7926	8032	7926
q10	4792	4789	4371	4371
q11	792	417	387	387
q12	753	748	542	542
q13	3290	3897	2999	2999
q14	308	311	271	271
q15	q16	710	733	653	653
q17	1369	1338	1327	1327
q18	8001	7394	7050	7050
q19	1163	1135	1160	1135
q20	2255	2247	1954	1954
q21	5258	4572	4468	4468
q22	523	445	411	411
Total cold run time: 57568 ms
Total hot run time: 51719 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 169143 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 96f1ab107627b730c665d302d3567e246d99589c, data reload: false

query5	4357	636	483	483
query6	448	200	182	182
query7	4809	555	309	309
query8	366	216	202	202
query9	8748	4018	3992	3992
query10	454	321	259	259
query11	5933	2325	2117	2117
query12	166	101	99	99
query13	1273	588	440	440
query14	6494	5461	5088	5088
query14_1	4406	4406	4387	4387
query15	212	198	181	181
query16	1000	495	444	444
query17	1192	729	606	606
query18	2723	478	353	353
query19	281	199	155	155
query20	122	112	108	108
query21	220	148	119	119
query22	13636	13507	13426	13426
query23	17287	16423	16152	16152
query23_1	16201	16282	16210	16210
query24	7508	1787	1307	1307
query24_1	1316	1287	1296	1287
query25	576	486	417	417
query26	1310	318	168	168
query27	2560	581	359	359
query28	4380	2016	2031	2016
query29	1101	628	504	504
query30	315	240	197	197
query31	1136	1126	969	969
query32	115	62	60	60
query33	539	331	259	259
query34	1189	1150	673	673
query35	772	783	682	682
query36	1452	1420	1229	1229
query37	151	105	89	89
query38	3199	3143	3064	3064
query39	922	931	900	900
query39_1	880	893	868	868
query40	224	124	103	103
query41	67	73	75	73
query42	100	94	92	92
query43	316	320	281	281
query44	
query45	199	189	180	180
query46	1085	1182	754	754
query47	2390	2412	2218	2218
query48	403	441	285	285
query49	629	481	384	384
query50	1012	356	251	251
query51	4587	4381	4248	4248
query52	87	88	78	78
query53	237	275	194	194
query54	269	219	197	197
query55	80	74	69	69
query56	243	232	229	229
query57	1438	1412	1318	1318
query58	245	219	206	206
query59	1606	1642	1408	1408
query60	300	232	234	232
query61	161	165	162	162
query62	700	667	577	577
query63	231	186	184	184
query64	2570	807	633	633
query65	
query66	1771	460	341	341
query67	29659	29734	29539	29539
query68	
query69	417	306	270	270
query70	971	974	915	915
query71	292	211	206	206
query72	3100	2717	2459	2459
query73	867	767	447	447
query74	5151	4978	4774	4774
query75	2674	2586	2252	2252
query76	2375	1137	749	749
query77	355	385	295	295
query78	12446	12309	11893	11893
query79	1408	1084	771	771
query80	1322	473	397	397
query81	525	285	244	244
query82	647	161	120	120
query83	330	284	248	248
query84	262	142	110	110
query85	926	542	451	451
query86	421	309	287	287
query87	3358	3414	3213	3213
query88	3638	2742	2727	2727
query89	450	373	330	330
query90	1990	182	187	182
query91	179	164	136	136
query92	67	66	54	54
query93	1586	1421	885	885
query94	721	330	314	314
query95	699	388	439	388
query96	1046	843	360	360
query97	2719	2729	2544	2544
query98	212	205	206	205
query99	1141	1180	1070	1070
Total cold run time: 253031 ms
Total hot run time: 169143 ms

@heguanhui heguanhui force-pushed the fix/segment-writer-inline-linker-error branch 2 times, most recently from ce47654 to 3369788 Compare June 8, 2026 02:16
@heguanhui

Copy link
Copy Markdown
Contributor Author

run buildall

@heguanhui heguanhui force-pushed the fix/segment-writer-inline-linker-error branch from 3369788 to 77cacdb Compare June 8, 2026 07:20
@heguanhui

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.89% (28297/38298)
Line Coverage 57.93% (308117/531853)
Region Coverage 54.80% (258298/471332)
Branch Coverage 56.18% (112032/199431)

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 29465 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 77cacdb5488886daa9303a31aa5ae919f92eb9fa, data reload: false

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17719	4099	3995	3995
q2	q3	10809	1474	871	871
q4	4689	487	352	352
q5	7558	897	598	598
q6	180	177	137	137
q7	796	853	644	644
q8	9352	1655	1539	1539
q9	5981	4480	4544	4480
q10	6764	1824	1540	1540
q11	445	280	255	255
q12	639	441	315	315
q13	18170	3439	2809	2809
q14	271	262	246	246
q15	q16	825	778	709	709
q17	1006	984	974	974
q18	7231	5715	5510	5510
q19	1305	1306	1088	1088
q20	542	410	265	265
q21	6277	2820	2867	2820
q22	468	387	318	318
Total cold run time: 101027 ms
Total hot run time: 29465 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	5090	4660	4741	4660
q2	q3	4865	5343	4767	4767
q4	2121	2183	1396	1396
q5	4814	4901	4737	4737
q6	227	176	129	129
q7	1907	1898	1623	1623
q8	2442	2111	2134	2111
q9	7816	7614	7437	7437
q10	4743	4664	4247	4247
q11	544	382	356	356
q12	733	734	536	536
q13	2947	3583	2816	2816
q14	270	270	257	257
q15	q16	673	703	620	620
q17	1301	1259	1266	1259
q18	7350	6901	6872	6872
q19	1124	1121	1093	1093
q20	2227	2228	1946	1946
q21	5309	4615	4445	4445
q22	541	456	406	406
Total cold run time: 57044 ms
Total hot run time: 51713 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 169275 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 77cacdb5488886daa9303a31aa5ae919f92eb9fa, data reload: false

query5	4326	604	475	475
query6	450	203	176	176
query7	4826	538	315	315
query8	381	221	215	215
query9	8789	4036	4044	4036
query10	436	319	262	262
query11	5924	2363	2131	2131
query12	150	102	101	101
query13	1262	637	415	415
query14	6398	5388	5031	5031
query14_1	4374	4340	4352	4340
query15	208	200	176	176
query16	1025	458	463	458
query17	926	705	566	566
query18	2441	480	347	347
query19	199	180	141	141
query20	112	110	108	108
query21	215	137	113	113
query22	13625	13560	13353	13353
query23	17349	16606	16172	16172
query23_1	16240	16277	16291	16277
query24	7503	1775	1303	1303
query24_1	1324	1306	1320	1306
query25	585	473	412	412
query26	1323	330	173	173
query27	2685	557	339	339
query28	4496	2030	2009	2009
query29	1138	628	505	505
query30	316	229	201	201
query31	1123	1084	952	952
query32	108	65	64	64
query33	540	346	274	274
query34	1167	1160	675	675
query35	770	806	674	674
query36	1427	1453	1262	1262
query37	161	111	104	104
query38	3250	3175	3062	3062
query39	931	936	888	888
query39_1	890	882	871	871
query40	232	127	109	109
query41	71	67	70	67
query42	106	106	96	96
query43	326	325	290	290
query44	
query45	199	190	183	183
query46	1100	1204	730	730
query47	2438	2413	2299	2299
query48	383	425	307	307
query49	651	493	405	405
query50	1035	363	258	258
query51	4399	4345	4253	4253
query52	92	90	81	81
query53	256	273	192	192
query54	285	237	226	226
query55	84	78	73	73
query56	257	241	246	241
query57	1452	1427	1320	1320
query58	260	227	225	225
query59	1579	1700	1410	1410
query60	295	263	248	248
query61	183	219	157	157
query62	707	647	591	591
query63	239	184	187	184
query64	2551	769	592	592
query65	
query66	1794	473	352	352
query67	29898	29703	29653	29653
query68	
query69	428	316	264	264
query70	937	955	948	948
query71	313	222	214	214
query72	3013	2722	2409	2409
query73	868	780	424	424
query74	5178	4964	4804	4804
query75	2668	2548	2250	2250
query76	2325	1166	780	780
query77	362	376	282	282
query78	12391	12470	11937	11937
query79	1441	1057	748	748
query80	767	461	384	384
query81	490	284	241	241
query82	565	155	121	121
query83	359	282	243	243
query84	
query85	919	522	436	436
query86	413	302	282	282
query87	3389	3311	3182	3182
query88	3625	2759	2778	2759
query89	438	391	328	328
query90	1818	173	173	173
query91	179	166	138	138
query92	64	63	56	56
query93	1466	1436	818	818
query94	612	336	318	318
query95	702	382	436	382
query96	1046	779	332	332
query97	2754	2687	2571	2571
query98	213	211	206	206
query99	1157	1191	1007	1007
Total cold run time: 251202 ms
Total hot run time: 169275 ms

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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

@yiguolei

yiguolei commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code review completed. I did not find blocking issues in this PR.

Critical checkpoint conclusions:

  • Goal and tests: The PR addresses the O1/O3 linker failure by moving the helper definitions into the headers where cross-translation-unit callers can see inline definitions. The new BE unit test is included by the existing recursive BE test glob and covers MOW true/false and cluster-key cases for both segment writer classes.
  • Scope: The implementation change is small and focused; it only relocates helper definitions and adds a targeted linker-regression test.
  • Concurrency: No new concurrency or shared mutable state is introduced.
  • Lifecycle/static initialization: No new static initialization dependency was introduced. The test directory constant is local to the test translation unit and does not affect production lifecycle.
  • Configuration/compatibility: No new configuration, storage format, RPC, or FE-BE protocol compatibility impact.
  • Parallel code paths: Both SegmentWriter and VerticalSegmentWriter are updated consistently.
  • Error handling/status: Production error handling is unchanged; the test checks filesystem setup statuses before use.
  • Test coverage: Coverage is appropriate for this linker/inline-definition regression. I did not run the BE unit test locally because no BE test binary/build output is available in this runner.
  • Observability: Not applicable for this compile/link-only fix.
  • Transaction/data correctness: Not applicable; no data visibility, version, rowset lifecycle, or delete bitmap behavior changes.
  • Performance/memory: No meaningful runtime performance or memory-accounting risk introduced; helpers are simple predicates that were already intended to be inline-capable.

User focus points: No additional user-provided review focus was specified.

@yiguolei yiguolei merged commit ad06c79 into apache:master Jun 9, 2026
30 of 31 checks passed
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.

BE UT linker error: undefined symbol SegmentWriter::_is_mow() and _is_mow_with_cluster_key() with -O1/-O3

4 participants