[
https://issues.apache.org/jira/browse/ARTEMIS-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16874211#comment-16874211
]
Justin Bertram commented on ARTEMIS-2184:
-----------------------------------------
As far as I can tell, AIO requires O_DIRECT. If you want to put the journal on
tmpfs then I recommend trying NIO.
> AIO does not start on tmpfs: RuntimeException:
> ActiveMQNativeIOError[errorType=NATIVE_ERROR_CANT_INITIALIZE_AIO
> message=Cannot open file:Invalid argument]
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ARTEMIS-2184
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2184
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: Broker
> Reporter: Jiri Daněk
> Priority: Trivial
>
> {{O_DIRECT}} flag is unsupported on tmpfs. There were attempts to add it to
> Linux kernel, which were rejected, as I understand it.
> [1] https://lists.gt.net/linux/kernel/720702
> [2]
> http://linux-kernel.2935.n7.nabble.com/PATCH-support-O-DIRECT-in-tmpfs-ramfs-td201650.html
> Is there a valid usecase for anyone wanting to put the journal on a ramdisk?
> My thinking was that I had only network storage available (GlusterFS as / and
> a NFS mount) and I wanted to avoid any network i/o when running broker
> (broker tests), to make it faster.
> Does AIO require O_DIRECT? Is it possible to use AIO on ramdisk, tmpfs?
> Related
> [3] https://issues.jboss.org/browse/JBEAP-1887 Artemis fails to load journal
> with libAIO on tmpfs file system
> [4] https://bugzilla.redhat.com/show_bug.cgi?id=1291237
> [5] https://dev.mysql.com/doc/refman/5.7/en/innodb-linux-native-aio.html
> {noformat}
> AIOJournalCompactTest.testCompactFirstFileWithPendingCommits2
> java.lang.RuntimeException:
> ActiveMQNativeIOError[errorType=NATIVE_ERROR_CANT_INITIALIZE_AIO
> message=Cannot open file:Invalid argument]
> at
> org.apache.activemq.artemis.core.journal.impl.JournalFilesRepository.unwrapException(JournalFilesRepository.java:592)
> at
> org.apache.activemq.artemis.core.journal.impl.JournalFilesRepository.createFile(JournalFilesRepository.java:580)
> at
> org.apache.activemq.artemis.core.journal.impl.JournalFilesRepository.ensureMinFiles(JournalFilesRepository.java:208)
> at
> org.apache.activemq.artemis.core.journal.impl.JournalImpl.setUpCurrentFile(JournalImpl.java:3017)
> at
> org.apache.activemq.artemis.core.journal.impl.JournalImpl.load(JournalImpl.java:2066)
> at
> org.apache.activemq.artemis.core.journal.impl.JournalImpl.load(JournalImpl.java:2116)
> at
> org.apache.activemq.artemis.core.journal.impl.JournalImpl.load(JournalImpl.java:1445)
> at
> org.apache.activemq.artemis.core.journal.Journal.load(Journal.java:200)
> at
> org.apache.activemq.artemis.tests.unit.core.journal.impl.JournalImplTestBase.loadAndCheck(JournalImplTestBase.java:256)
> at
> org.apache.activemq.artemis.tests.unit.core.journal.impl.JournalImplTestBase.loadAndCheck(JournalImplTestBase.java:248)
> at
> org.apache.activemq.artemis.tests.integration.journal.NIOJournalCompactTest.testCompactFirstFileWithPendingCommits2(NIOJournalCompactTest.java:1411)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
> at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
> at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
> at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
> at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
> at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
> at org.junit.rules.RunRules.evaluate(RunRules.java:20)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> at
> com.google.testing.junit.runner.internal.junit4.CancellableRequestFactory$CancellableRunner.run(CancellableRequestFactory.java:89)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
> at
> com.google.testing.junit.runner.junit4.JUnit4Runner.run(JUnit4Runner.java:112)
> at
> com.google.testing.junit.runner.BazelTestRunner.runTestsInSuite(BazelTestRunner.java:144)
> at
> com.google.testing.junit.runner.BazelTestRunner.main(BazelTestRunner.java:82)
> Caused by: ActiveMQNativeIOError[errorType=NATIVE_ERROR_CANT_INITIALIZE_AIO
> message=Cannot open file:Invalid argument]
> at
> org.apache.activemq.artemis.core.io.aio.AIOSequentialFile.open(AIOSequentialFile.java:177)
> at
> org.apache.activemq.artemis.core.journal.impl.JournalFilesRepository.createFile0(JournalFilesRepository.java:613)
> at
> org.apache.activemq.artemis.core.journal.impl.JournalFilesRepository.access$100(JournalFilesRepository.java:45)
> at
> org.apache.activemq.artemis.core.journal.impl.JournalFilesRepository$2.run(JournalFilesRepository.java:576)
> at
> org.apache.activemq.artemis.core.journal.impl.JournalFilesRepository$2.run(JournalFilesRepository.java:573)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.apache.activemq.artemis.core.journal.impl.JournalFilesRepository.createFile(JournalFilesRepository.java:573)
> ... 42 more
> Caused by: java.io.IOException: Cannot open file:Invalid argument
> at org.apache.activemq.artemis.jlibaio.LibaioContext.open(Native Method)
> at
> org.apache.activemq.artemis.jlibaio.LibaioContext.openFile(LibaioContext.java:285)
> at
> org.apache.activemq.artemis.jlibaio.LibaioContext.openFile(LibaioContext.java:268)
> at
> org.apache.activemq.artemis.core.io.aio.AIOSequentialFile.open(AIOSequentialFile.java:173)
> ... 48 more
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)