smengcl opened a new pull request, #11635:
URL: https://github.com/apache/ozone/pull/11635

   Generated-by: Claude Code (Opus 5.5)
   
   ## What changes were proposed in this pull request?
   
   The native rocks-tools library in 2.2.1 cannot be loaded on Rocky Linux 9 / 
RHEL 9, including the official `apache/ozone:2.2.1` image:
   
   ```
   java.lang.UnsatisfiedLinkError: .../libozone_rocksdb_tools.so: 
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.32' not found
   ```
   
   As a result `ozone debug checknative` reports `rocks-tools: false`, snapshot 
diff always falls back to a full diff, and SST pruning in 
`RocksDBCheckpointDiffer` is skipped.
   
   The only `GLIBCXX_3.4.32` symbol the library needs is 
`std::ios_base_library_init()`, which GCC 13+ references in every translation 
unit that includes `<iostream>`. `ManagedRawSSTFileIterator.cpp` and 
`ManagedRawSSTFileReader.cpp` include `<iostream>` but use no streams. Rocky 9 
ships libstdc++ from GCC 11 (up to `GLIBCXX_3.4.29`).
   
   This PR removes the unused `#include <iostream>` from both files, and 
includes `<algorithm>` and `<cstring>` explicitly in 
`ManagedRawSSTFileIterator.cpp` for `std::min` and `std::memcpy`.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17153
   
   ## How was this patch tested?
   
   - Compiled both sources with the `-Drocks_tools_native` CMake flags before 
and after the change. Each original object has one undefined reference to 
`std::ios_base_library_init()`, the fixed objects have none.
   - Native build on master (RocksDB 10.10.1.1, GCC 13.3): the resulting 
`libozone_rocksdb_tools.so` has no `ios_base_library_init` reference and needs 
at most `GLIBCXX_3.4.14`. `hdds-rocks-native` tests pass 
(`TestNativeLibraryLoader`, `TestManagedRawSSTFileIterator`, 
`TestLatestVersionedKWayMergeIterator`, 
`TestLatestVersionedKWayMergeIteratorOverSst`).
   - Confirmed the root cause on the published `hdds-rocks-native-2.2.1.jar` 
with `objdump -T` and `readelf -p .comment`.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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