Skip to content

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

Open
heguanhui wants to merge 1 commit into
apache:masterfrom
heguanhui:fix/segment-writer-inline-linker-error
Open

[fix](storage) Fix linker error for SegmentWriter::_is_mow() with -O1/-O3#63928
heguanhui wants to merge 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
Copy link
Copy Markdown
Contributor

@liaoxin01 liaoxin01 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
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

PR approved by anyone and no changes requested.

@yiguolei
Copy link
Copy Markdown
Contributor

yiguolei commented Jun 1, 2026

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)

…/-O3

### What problem does this PR solve?

Issue Number: close apache#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 74aa0ca defined these methods with the `inline`
keyword in .cpp files. 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 4616202
introduced TestSegmentWriter (a friend subclass) 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.

### 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
- Behavior changed: No
- Does this need documentation: No
@heguanhui heguanhui force-pushed the fix/segment-writer-inline-linker-error branch from e27240b to 1c35ec3 Compare June 3, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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