[ISSUE #10334] Make native CqCompactionFilter shim self-contained without rocksdbjni dependency#10371
Merged
lollipopjin merged 2 commits intoMay 25, 2026
Conversation
…ed without rocksdbjni dependency Remove DT_NEEDED on librocksdbjni by including stub vtable implementations for all platforms. Simplify CqCompactionFilterJni loader and add synchronized lifecycle management with proper destroy in preShutdown(). Recompile all platform binaries (x86_64, aarch64, Windows) with JDK 8 headers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ing JDK 8 headers Recompiled libcq_compaction_filter.dylib on macOS arm64 with the same self-contained stub approach — no dependency on librocksdbjni. Built with JDK 8 headers for maximum compatibility (verified on JDK 8 and 21). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #10371 +/- ##
=============================================
- Coverage 48.95% 48.86% -0.10%
+ Complexity 13472 13450 -22
=============================================
Files 1376 1376
Lines 100546 100537 -9
Branches 12984 12983 -1
=============================================
- Hits 49225 49129 -96
- Misses 45319 45391 +72
- Partials 6002 6017 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DT_NEEDEDdependency onlibrocksdbjniensureRocksDBNativeLoaded()fromCqCompactionFilterJni— the shim no longer needs rocksdbjni loaded firstFILTER_LOCK) with properdestroyNativeFilter()called inpreShutdown()Motivation
The previous shim had a
DT_NEEDEDonlibrocksdbjni-linux64.so. Since rocksdbjni has no SONAME,dlopenuses pathname-based dedup — different temp extraction paths produce different inodes, causing a second copy of rocksdbjni to be loaded into the process. Two copies of RocksDB global state (Env, thread pools) coexist, leading to intermittent SIGSEGV.Changes
CqCompactionFilterJni.javaensureRocksDBNativeLoaded(); addFILTER_LOCK+destroyNativeFilter(); simplifyloadNativeShim()ConsumeQueueRocksDBStorage.javaCqCompactionFilterJni.destroyNativeFilter()inpreShutdown()cq_compaction_filter.cpp#ifdef _WIN32guard on stubs — now unconditional for all platformslibcq_compaction_filter.solibcq_compaction_filter_aarch64.solibcq_compaction_filter.dylibcq_compaction_filter.dlldocs/en/Native_RocksDB.mdVerification
Test plan
CqCompactionFilterJniTestpasses on Linux x86_64, aarch64, Windows x64, macOS arm64objdump -pconfirms no DT_NEEDED on librocksdbjni🤖 Generated with Claude Code