[fix](storage) Fix linker error for SegmentWriter::_is_mow() with -O1/-O3#63928
[fix](storage) Fix linker error for SegmentWriter::_is_mow() with -O1/-O3#63928heguanhui wants to merge 1 commit into
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
690328a to
804c31c
Compare
|
PR approved by anyone and no changes requested. |
|
run buildall |
TPC-H: Total hot run time: 29263 ms |
TPC-DS: Total hot run time: 170825 ms |
804c31c to
04717d8
Compare
|
run buildall |
TPC-H: Total hot run time: 28727 ms |
TPC-DS: Total hot run time: 170738 ms |
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
|
/review |
TPC-H: Total hot run time: 29389 ms |
TPC-DS: Total hot run time: 169461 ms |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
1 similar comment
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
…/-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
e27240b to
1c35ec3
Compare
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 forSegmentWriter::_is_mow(),SegmentWriter::_is_mow_with_cluster_key(), and theirVerticalSegmentWritercounterparts.Root cause: Commit
74aa0ca63adefined these methods with theinlinekeyword in.cppfiles (segment_writer.cppandvertical_segment_writer.cpp). At-O0(ASAN), the compiler ignoresinlineand exports the symbol, so linking succeeds. At-O1/-O3, the compiler inlines the function and does NOT export the symbol. When commit4616202fc4introducedTestSegmentWriter(a friend subclass) intest_segment_writer.hthat calls these private methods from a different translation unit, the linker cannot find the symbols.Fix: Move the
inlinedefinitions from.cppfiles into the header files as class-internal inline definitions, so they are visible to all translation units.Error example (TSAN build):
Release note
None
Check List (For Author)
Test
segment_writer_mow_check_test.cppwith 7 test cases covering all logic branches for bothSegmentWriterandVerticalSegmentWriterBehavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)