bobhan1 opened a new pull request, #70736:
URL: https://github.com/apache/doris/pull/70736

   ### Background
   
   Compaction maps input row IDs to output segment and row IDs for delete 
bitmap conversion and inverted-index merging. The row-ID conversion 
implementation stores its dense, lazy-chunked, and compressed layouts in a 
`std::variant`.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: #70350 (introduced the compile failure)
   PR Type: Bugfix
   
   Problem Summary:
   
   The Performance lane's GCC 15.1.0 Release build fails when compiling the 
Storage unity batch. GCC reports `-Werror=subobject-linkage` on 
`RowIdConversion::Storage` at `rowid_conversion.cpp:199`. Give the storage 
alternatives and their destination type external linkage.
   
   ### Details
   
   - **Frequency:** Always when the affected source is compiled as part of the 
Storage unity batch with GCC 15.1.0 and `-Werror`.
   - **Root cause:** The externally linked `RowIdConversion::Storage` contains 
a variant whose three alternatives have internal linkage. The destination type 
is also an anonymous-namespace member type of the dense and lazy-chunked 
alternatives.
   - **Why existing tests missed it:** 
`CompressedRowIdMapTest.StorageAlternativesReleaseAllTrackedMemory` checks all 
three layouts and their memory accounting. `test_mow_compaction_and_read_stale` 
checks visible rows after compaction. Both exercise runtime results after BE 
has compiled. The failing condition is specific to the compiler and unity build.
   - **Fix:** Close the anonymous namespace before the storage types and their 
shared destination type. Their definitions stay in the implementation file.
   - **Other paths and branches:** Local and cloud compaction share the Storage 
target. The affected Apache Doris branch is `master`, where #70350 added this 
implementation. The checked `branch-3.1`, `branch-4.0`, `branch-4.1`, and 
`branch-4.2` tips predate it.
   
   ### Testing
   
   - Compiled the same Storage unity translation unit locally with the GCC 
15.1.0 Release command generated by `build.sh --be`. With unity enabled, PCH 
disabled, and `-Werror` active, the baseline `6e7bea93c53` failed with 
`-Werror=subobject-linkage` and the fix produced the object file successfully.
   
   - Compiled the patched Storage unity translation unit locally with Clang 
20.1.8 in the Release BE configuration with unity enabled, PCH disabled, and 
coverage enabled.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Partially verified: full local GCC 15.1.0 Release 
BE build in progress.
   
   ### AI Disclosure
   
   - Tool: Codex (GPT-6)
   - Generated: Code change and PR description
   - Human review: not stated
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to