Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.16.2 enable direct io on x86 fail to start up #4043

Closed
lifepuzzlefun opened this issue Aug 7, 2023 · 6 comments
Closed

4.16.2 enable direct io on x86 fail to start up #4043

lifepuzzlefun opened this issue Aug 7, 2023 · 6 comments
Labels

Comments

@lifepuzzlefun
Copy link
Contributor

lifepuzzlefun commented Aug 7, 2023

file libnative-io.so 
libnative-io.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=e2e135126a32702ae521bbc392aaefdc665a8af0, not stripped 

you can see the 4.16.2 so is arm distributed.

when you start bookie the exception throws

2023-08-07T16:03:55,249+0800 [BookieShutdownTrigger] ERROR org.apache.bookkeeper.bookie.BookieThread - Uncaught exception in thread BookieShutdownTrigger
java.lang.NoClassDefFoundError: Could not initialize class org.apache.bookkeeper.common.util.nativeio.NativeIOJni
	at org.apache.bookkeeper.common.util.nativeio.NativeIOImpl.open(NativeIOImpl.java:29) ~[org.apache.bookkeeper-native-io-4.16.2.jar:?]
	at org.apache.bookkeeper.bookie.storage.directentrylogger.DirectWriter.<init>(DirectWriter.java:69) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.directentrylogger.DirectEntryLogger.newDirectWriter(DirectEntryLogger.java:450) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.directentrylogger.DirectEntryLogger.addEntry(DirectEntryLogger.java:189) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.ldb.SingleDirectoryDbLedgerStorage.lambda$checkpoint$8(SingleDirectoryDbLedgerStorage.java:810) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.ldb.WriteCache.forEach(WriteCache.java:273) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.ldb.SingleDirectoryDbLedgerStorage.checkpoint(SingleDirectoryDbLedgerStorage.java:809) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.ldb.SingleDirectoryDbLedgerStorage.flush(SingleDirectoryDbLedgerStorage.java:899) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.ldb.SingleDirectoryDbLedgerStorage.shutdown(SingleDirectoryDbLedgerStorage.java:336) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage.shutdown(DbLedgerStorage.java:307) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.BookieImpl.shutdown(BookieImpl.java:873) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.BookieImpl$7.run(BookieImpl.java:833) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: /tmp/native138667574660649515/libnative-io.so: /tmp/native138667574660649515/libnative-io.so: cannot open shared object file: No such file or directory (Possible cause: can't load AARCH64 .so on a AMD 64 platform) [in thread "db-storage-6-1"]
	at jdk.internal.loader.NativeLibraries.load(Native Method) ~[?:?]
	at jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388) ~[?:?]
	at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232) ~[?:?]
	at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174) ~[?:?]
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:2389) ~[?:?]
	at java.lang.Runtime.load0(Runtime.java:755) ~[?:?]
	at java.lang.System.load(System.java:1953) ~[?:?]
	at org.apache.bookkeeper.common.util.nativeio.NativeUtils.loadLibraryFromJar(NativeUtils.java:78) ~[org.apache.bookkeeper-native-io-4.16.2.jar:?]
	at org.apache.bookkeeper.common.util.nativeio.NativeIOJni.<clinit>(NativeIOJni.java:56) ~[org.apache.bookkeeper-native-io-4.16.2.jar:?]
	at org.apache.bookkeeper.common.util.nativeio.NativeIOImpl.open(NativeIOImpl.java:29) ~[org.apache.bookkeeper-native-io-4.16.2.jar:?]
	at org.apache.bookkeeper.bookie.storage.directentrylogger.DirectWriter.<init>(DirectWriter.java:69) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.directentrylogger.DirectEntryLogger.newDirectWriter(DirectEntryLogger.java:450) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.directentrylogger.DirectEntryLogger.addEntry(DirectEntryLogger.java:189) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.ldb.SingleDirectoryDbLedgerStorage.lambda$checkpoint$8(SingleDirectoryDbLedgerStorage.java:810) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.ldb.WriteCache.forEach(WriteCache.java:273) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.ldb.SingleDirectoryDbLedgerStorage.checkpoint(SingleDirectoryDbLedgerStorage.java:809) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.ldb.SingleDirectoryDbLedgerStorage.flush(SingleDirectoryDbLedgerStorage.java:899) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at org.apache.bookkeeper.bookie.storage.ldb.SingleDirectoryDbLedgerStorage.lambda$triggerFlushAndAddEntry$7(SingleDirectoryDbLedgerStorage.java:520) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty-netty-common-4.1.86.Final.jar:4.1.86.Final]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
@lifepuzzlefun
Copy link
Contributor Author

lifepuzzlefun commented Aug 12, 2023

more on this. hope help other people solve this problem.

build on linux and check the so file

~/git/bookkeeper/bookkeeper-dist/server/target/bookkeeper-server-4.17.0-SNAPSHOT/lib/lib$ file libnative-io.so
libnative-io.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=1893d115509fc5ad9535537bf114cae13a5183d0, not stripped

build on mac x86 chip.

file libnative-io.jnilib
libnative-io.jnilib: Mach-O 64-bit bundle x86_64

but seems build on x86 mac chip still can't run on x86 linux.

@shoothzj
Copy link
Member

shoothzj commented May 5, 2024

@lifepuzzlefun currently, we don't support cross compile in nar-maven-plugin. When you want to use direct io, you should compile it in linux x86 env.

@shoothzj shoothzj closed this as completed May 5, 2024
@lifepuzzlefun
Copy link
Contributor Author

@lifepuzzlefun currently, we don't support cross compile in nar-maven-plugin. When you want to use direct io, you should compile it in linux x86 env.

I wonder if you ever checked the current release fix. And for most software the different platform will be release differently. and not need the user compile byself. (do not reply thank you.

@shoothzj shoothzj reopened this May 5, 2024
@shoothzj
Copy link
Member

shoothzj commented May 5, 2024

@lifepuzzlefun Sorry for my negligence,I only noticed that mac compile can't run on x86 machine.
I will check the latest release later.

@shoothzj
Copy link
Member

shoothzj commented May 5, 2024

@lifepuzzlefun IMO, our release process is make sure it works on x86 platform since we didn't support cross compile.

@shoothzj
Copy link
Member

shoothzj commented May 7, 2024

@lifepuzzlefun I use file command test 4.16.4, 4.16.5, 4.17.0, it's both x86 arch, I think we can close this issue now. Feel free to reopen it if you still have other questions :)

@shoothzj shoothzj closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants