[jira] [Updated] (CASSANDRA-16002) jvm upgrade dtests fail on java 11 caused by bad initialization order of DatabaseDescriptor and FileUtils

2020-08-27 Thread Alex Petrov (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-16002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Petrov updated CASSANDRA-16002:

Component/s: (was: Test/dtest/python)
 Test/dtest/java

> jvm upgrade dtests fail on java 11 caused by bad initialization order of 
> DatabaseDescriptor and FileUtils
> -
>
> Key: CASSANDRA-16002
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16002
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/dtest/java
>Reporter: David Capwell
>Assignee: David Capwell
>Priority: Normal
> Fix For: 3.0.22, 3.11.8, 4.0-beta2
>
>
> In FileUtils we check to see if we have access to some classes (specifically 
> to set org.apache.cassandra.io.util.FileUtils#isCleanerAvailable), which can 
> fail in java 11.  This is fine with CassandraDaemon as it will just log the 
> failure, but in in-jvm dtests this can fail to startup an instance with the 
> following
> {code}
> java.lang.RuntimeException: java.lang.RuntimeException: 
> java.lang.AssertionError: network topology must be assigned before using 
> snitch
>   at 
> org.apache.cassandra.distributed.impl.IsolatedExecutor.waitOn(IsolatedExecutor.java:209)
>   at 
> org.apache.cassandra.distributed.impl.IsolatedExecutor.lambda$sync$7(IsolatedExecutor.java:112)
>   at 
> org.apache.cassandra.distributed.impl.Instance.startup(Instance.java:592)
>   at 
> org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.startup(AbstractCluster.java:209)
>   at 
> org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.startup(AbstractCluster.java:200)
>   at 
> org.apache.cassandra.distributed.upgrade.UpgradeTestBase$TestCase.run(UpgradeTestBase.java:179)
>   at 
> org.apache.cassandra.distributed.upgrade.UpgradeTest.upgradeTest(UpgradeTest.java:50)
>   at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> Caused by: java.lang.RuntimeException: java.lang.AssertionError: network 
> topology must be assigned before using snitch
>   at 
> org.apache.cassandra.distributed.impl.Instance.lambda$startup$7(Instance.java:590)
>   at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
>   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>   at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>   at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>   at 
> org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:83)
>   at java.base/java.lang.Thread.run(Thread.java:834)
> Caused by: java.lang.AssertionError: network topology must be assigned before 
> using snitch
>   at 
> org.apache.cassandra.distributed.impl.DistributedTestSnitch.getDatacenter(DistributedTestSnitch.java:90)
>   at 
> org.apache.cassandra.distributed.impl.DistributedTestSnitch.getDatacenter(DistributedTestSnitch.java:85)
>   at 
> org.apache.cassandra.locator.DynamicEndpointSnitch.getDatacenter(DynamicEndpointSnitch.java:118)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:488)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.(DatabaseDescriptor.java:137)
>   at 
> org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:102)
>   at 
> org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:60)
>   at org.apache.cassandra.io.util.FileUtils.(FileUtils.java:78)
>   at 
> org.apache.cassandra.distributed.impl.Instance.lambda$startup$7(Instance.java:509)
> {code}
> The exception isn’t clear, but what is happening is the following
> {code}
> static
> {
> boolean canClean = false;
> try
> {
> ByteBuffer buf = ByteBuffer.allocateDirect(1);
> ((DirectBuffer) buf).cleaner().clean();
> canClean = true;
> }
> catch (Throwable t)
> {
> JVMStabilityInspector.inspectThrowable(t);
> logger.info("Cannot initialize un-mmaper.  (Are you using a 
> non-Oracle JVM?)  Compacted data files will not be removed promptly.  
> Consider using an Oracle JVM or using standard disk access mode");
> }
> canCleanDirectBuffers = canClean;
> }
> {code}
> JVMStabilityInspector will check the throwable which will eventually call 
> org.apache.cassandra.config.Databas

[jira] [Updated] (CASSANDRA-16002) jvm upgrade dtests fail on java 11 caused by bad initialization order of DatabaseDescriptor and FileUtils

2020-07-30 Thread David Capwell (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-16002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Capwell updated CASSANDRA-16002:
--
  Fix Version/s: (was: 4.0-beta)
 (was: 3.11.x)
 (was: 3.0.x)
 4.0-beta2
 3.11.8
 3.0.22
  Since Version: 3.0.21
Source Control Link: 
https://github.com/apache/cassandra/commit/624d01660bdad4dc924717f4c602ce6241c0c825
 Resolution: Fixed
 Status: Resolved  (was: Ready to Commit)

CI results
3.0: 
https://app.circleci.com/pipelines/github/dcapwell/cassandra/395/workflows/8bd01d34-7280-4176-8b31-180d193e8125
3.11: 
https://app.circleci.com/pipelines/github/dcapwell/cassandra/396/workflows/cbba3a88-3371-47b6-9100-1e806efa6ce5
trunk: 
https://app.circleci.com/pipelines/github/dcapwell/cassandra/397/workflows/89e13b1f-6395-4a7e-a16c-0d33497dd7c4

there are failing tests, but they are known flaky.

> jvm upgrade dtests fail on java 11 caused by bad initialization order of 
> DatabaseDescriptor and FileUtils
> -
>
> Key: CASSANDRA-16002
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16002
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/dtest
>Reporter: David Capwell
>Assignee: David Capwell
>Priority: Normal
> Fix For: 3.0.22, 3.11.8, 4.0-beta2
>
>
> In FileUtils we check to see if we have access to some classes (specifically 
> to set org.apache.cassandra.io.util.FileUtils#isCleanerAvailable), which can 
> fail in java 11.  This is fine with CassandraDaemon as it will just log the 
> failure, but in in-jvm dtests this can fail to startup an instance with the 
> following
> {code}
> java.lang.RuntimeException: java.lang.RuntimeException: 
> java.lang.AssertionError: network topology must be assigned before using 
> snitch
>   at 
> org.apache.cassandra.distributed.impl.IsolatedExecutor.waitOn(IsolatedExecutor.java:209)
>   at 
> org.apache.cassandra.distributed.impl.IsolatedExecutor.lambda$sync$7(IsolatedExecutor.java:112)
>   at 
> org.apache.cassandra.distributed.impl.Instance.startup(Instance.java:592)
>   at 
> org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.startup(AbstractCluster.java:209)
>   at 
> org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.startup(AbstractCluster.java:200)
>   at 
> org.apache.cassandra.distributed.upgrade.UpgradeTestBase$TestCase.run(UpgradeTestBase.java:179)
>   at 
> org.apache.cassandra.distributed.upgrade.UpgradeTest.upgradeTest(UpgradeTest.java:50)
>   at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> Caused by: java.lang.RuntimeException: java.lang.AssertionError: network 
> topology must be assigned before using snitch
>   at 
> org.apache.cassandra.distributed.impl.Instance.lambda$startup$7(Instance.java:590)
>   at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
>   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>   at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>   at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>   at 
> org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:83)
>   at java.base/java.lang.Thread.run(Thread.java:834)
> Caused by: java.lang.AssertionError: network topology must be assigned before 
> using snitch
>   at 
> org.apache.cassandra.distributed.impl.DistributedTestSnitch.getDatacenter(DistributedTestSnitch.java:90)
>   at 
> org.apache.cassandra.distributed.impl.DistributedTestSnitch.getDatacenter(DistributedTestSnitch.java:85)
>   at 
> org.apache.cassandra.locator.DynamicEndpointSnitch.getDatacenter(DynamicEndpointSnitch.java:118)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:488)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.(DatabaseDescriptor.java:137)
>   at 
> org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:102)
>   at 
> org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:60)
>   at org.apache.cassandra.io.util.FileUtils.(FileUtils.java:78)
>   at 
> org.apache.cassandra.distributed.impl.Instance.l

[jira] [Updated] (CASSANDRA-16002) jvm upgrade dtests fail on java 11 caused by bad initialization order of DatabaseDescriptor and FileUtils

2020-07-30 Thread David Capwell (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-16002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Capwell updated CASSANDRA-16002:
--
Status: Ready to Commit  (was: Review In Progress)

> jvm upgrade dtests fail on java 11 caused by bad initialization order of 
> DatabaseDescriptor and FileUtils
> -
>
> Key: CASSANDRA-16002
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16002
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/dtest
>Reporter: David Capwell
>Assignee: David Capwell
>Priority: Normal
> Fix For: 3.0.x, 3.11.x, 4.0-beta
>
>
> In FileUtils we check to see if we have access to some classes (specifically 
> to set org.apache.cassandra.io.util.FileUtils#isCleanerAvailable), which can 
> fail in java 11.  This is fine with CassandraDaemon as it will just log the 
> failure, but in in-jvm dtests this can fail to startup an instance with the 
> following
> {code}
> java.lang.RuntimeException: java.lang.RuntimeException: 
> java.lang.AssertionError: network topology must be assigned before using 
> snitch
>   at 
> org.apache.cassandra.distributed.impl.IsolatedExecutor.waitOn(IsolatedExecutor.java:209)
>   at 
> org.apache.cassandra.distributed.impl.IsolatedExecutor.lambda$sync$7(IsolatedExecutor.java:112)
>   at 
> org.apache.cassandra.distributed.impl.Instance.startup(Instance.java:592)
>   at 
> org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.startup(AbstractCluster.java:209)
>   at 
> org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.startup(AbstractCluster.java:200)
>   at 
> org.apache.cassandra.distributed.upgrade.UpgradeTestBase$TestCase.run(UpgradeTestBase.java:179)
>   at 
> org.apache.cassandra.distributed.upgrade.UpgradeTest.upgradeTest(UpgradeTest.java:50)
>   at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> Caused by: java.lang.RuntimeException: java.lang.AssertionError: network 
> topology must be assigned before using snitch
>   at 
> org.apache.cassandra.distributed.impl.Instance.lambda$startup$7(Instance.java:590)
>   at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
>   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>   at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>   at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>   at 
> org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:83)
>   at java.base/java.lang.Thread.run(Thread.java:834)
> Caused by: java.lang.AssertionError: network topology must be assigned before 
> using snitch
>   at 
> org.apache.cassandra.distributed.impl.DistributedTestSnitch.getDatacenter(DistributedTestSnitch.java:90)
>   at 
> org.apache.cassandra.distributed.impl.DistributedTestSnitch.getDatacenter(DistributedTestSnitch.java:85)
>   at 
> org.apache.cassandra.locator.DynamicEndpointSnitch.getDatacenter(DynamicEndpointSnitch.java:118)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:488)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.(DatabaseDescriptor.java:137)
>   at 
> org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:102)
>   at 
> org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:60)
>   at org.apache.cassandra.io.util.FileUtils.(FileUtils.java:78)
>   at 
> org.apache.cassandra.distributed.impl.Instance.lambda$startup$7(Instance.java:509)
> {code}
> The exception isn’t clear, but what is happening is the following
> {code}
> static
> {
> boolean canClean = false;
> try
> {
> ByteBuffer buf = ByteBuffer.allocateDirect(1);
> ((DirectBuffer) buf).cleaner().clean();
> canClean = true;
> }
> catch (Throwable t)
> {
> JVMStabilityInspector.inspectThrowable(t);
> logger.info("Cannot initialize un-mmaper.  (Are you using a 
> non-Oracle JVM?)  Compacted data files will not be removed promptly.  
> Consider using an Oracle JVM or using standard disk access mode");
> }
> canCleanDirectBuffers = canClean;
> }
> {code}
> JVMStabilityInspector will check the throwable which will eventually call 
> org.apache.cassandra.config.DatabaseDescriptor#getDiskFailureP

[jira] [Updated] (CASSANDRA-16002) jvm upgrade dtests fail on java 11 caused by bad initialization order of DatabaseDescriptor and FileUtils

2020-07-30 Thread David Capwell (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-16002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Capwell updated CASSANDRA-16002:
--
Reviewers: Jon Meredith, Jordan West  (was: Jordan West)

> jvm upgrade dtests fail on java 11 caused by bad initialization order of 
> DatabaseDescriptor and FileUtils
> -
>
> Key: CASSANDRA-16002
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16002
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/dtest
>Reporter: David Capwell
>Assignee: David Capwell
>Priority: Normal
> Fix For: 3.0.x, 3.11.x, 4.0-beta
>
>
> In FileUtils we check to see if we have access to some classes (specifically 
> to set org.apache.cassandra.io.util.FileUtils#isCleanerAvailable), which can 
> fail in java 11.  This is fine with CassandraDaemon as it will just log the 
> failure, but in in-jvm dtests this can fail to startup an instance with the 
> following
> {code}
> java.lang.RuntimeException: java.lang.RuntimeException: 
> java.lang.AssertionError: network topology must be assigned before using 
> snitch
>   at 
> org.apache.cassandra.distributed.impl.IsolatedExecutor.waitOn(IsolatedExecutor.java:209)
>   at 
> org.apache.cassandra.distributed.impl.IsolatedExecutor.lambda$sync$7(IsolatedExecutor.java:112)
>   at 
> org.apache.cassandra.distributed.impl.Instance.startup(Instance.java:592)
>   at 
> org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.startup(AbstractCluster.java:209)
>   at 
> org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.startup(AbstractCluster.java:200)
>   at 
> org.apache.cassandra.distributed.upgrade.UpgradeTestBase$TestCase.run(UpgradeTestBase.java:179)
>   at 
> org.apache.cassandra.distributed.upgrade.UpgradeTest.upgradeTest(UpgradeTest.java:50)
>   at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> Caused by: java.lang.RuntimeException: java.lang.AssertionError: network 
> topology must be assigned before using snitch
>   at 
> org.apache.cassandra.distributed.impl.Instance.lambda$startup$7(Instance.java:590)
>   at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
>   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>   at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>   at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>   at 
> org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:83)
>   at java.base/java.lang.Thread.run(Thread.java:834)
> Caused by: java.lang.AssertionError: network topology must be assigned before 
> using snitch
>   at 
> org.apache.cassandra.distributed.impl.DistributedTestSnitch.getDatacenter(DistributedTestSnitch.java:90)
>   at 
> org.apache.cassandra.distributed.impl.DistributedTestSnitch.getDatacenter(DistributedTestSnitch.java:85)
>   at 
> org.apache.cassandra.locator.DynamicEndpointSnitch.getDatacenter(DynamicEndpointSnitch.java:118)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:488)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.(DatabaseDescriptor.java:137)
>   at 
> org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:102)
>   at 
> org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:60)
>   at org.apache.cassandra.io.util.FileUtils.(FileUtils.java:78)
>   at 
> org.apache.cassandra.distributed.impl.Instance.lambda$startup$7(Instance.java:509)
> {code}
> The exception isn’t clear, but what is happening is the following
> {code}
> static
> {
> boolean canClean = false;
> try
> {
> ByteBuffer buf = ByteBuffer.allocateDirect(1);
> ((DirectBuffer) buf).cleaner().clean();
> canClean = true;
> }
> catch (Throwable t)
> {
> JVMStabilityInspector.inspectThrowable(t);
> logger.info("Cannot initialize un-mmaper.  (Are you using a 
> non-Oracle JVM?)  Compacted data files will not be removed promptly.  
> Consider using an Oracle JVM or using standard disk access mode");
> }
> canCleanDirectBuffers = canClean;
> }
> {code}
> JVMStabilityInspector will check the throwable which will eventually call 
> org.apache.cassandra.config.DatabaseDescriptor#getDiskFa

[jira] [Updated] (CASSANDRA-16002) jvm upgrade dtests fail on java 11 caused by bad initialization order of DatabaseDescriptor and FileUtils

2020-07-30 Thread Jordan West (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-16002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jordan West updated CASSANDRA-16002:

Reviewers: Jordan West, Jordan West  (was: Jordan West)
   Jordan West, Jordan West
   Status: Review In Progress  (was: Patch Available)

+1 LGTM. For 3.0/3.11 moving the logging line above the stability inspector 
call makes sense because the JVM can be killed before reaching the log line. 
For trunk, logging the exceptions for additional information also makes sense. 

> jvm upgrade dtests fail on java 11 caused by bad initialization order of 
> DatabaseDescriptor and FileUtils
> -
>
> Key: CASSANDRA-16002
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16002
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/dtest
>Reporter: David Capwell
>Assignee: David Capwell
>Priority: Normal
> Fix For: 3.0.x, 3.11.x, 4.0-beta
>
>
> In FileUtils we check to see if we have access to some classes (specifically 
> to set org.apache.cassandra.io.util.FileUtils#isCleanerAvailable), which can 
> fail in java 11.  This is fine with CassandraDaemon as it will just log the 
> failure, but in in-jvm dtests this can fail to startup an instance with the 
> following
> {code}
> java.lang.RuntimeException: java.lang.RuntimeException: 
> java.lang.AssertionError: network topology must be assigned before using 
> snitch
>   at 
> org.apache.cassandra.distributed.impl.IsolatedExecutor.waitOn(IsolatedExecutor.java:209)
>   at 
> org.apache.cassandra.distributed.impl.IsolatedExecutor.lambda$sync$7(IsolatedExecutor.java:112)
>   at 
> org.apache.cassandra.distributed.impl.Instance.startup(Instance.java:592)
>   at 
> org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.startup(AbstractCluster.java:209)
>   at 
> org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.startup(AbstractCluster.java:200)
>   at 
> org.apache.cassandra.distributed.upgrade.UpgradeTestBase$TestCase.run(UpgradeTestBase.java:179)
>   at 
> org.apache.cassandra.distributed.upgrade.UpgradeTest.upgradeTest(UpgradeTest.java:50)
>   at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> Caused by: java.lang.RuntimeException: java.lang.AssertionError: network 
> topology must be assigned before using snitch
>   at 
> org.apache.cassandra.distributed.impl.Instance.lambda$startup$7(Instance.java:590)
>   at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
>   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>   at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>   at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>   at 
> org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:83)
>   at java.base/java.lang.Thread.run(Thread.java:834)
> Caused by: java.lang.AssertionError: network topology must be assigned before 
> using snitch
>   at 
> org.apache.cassandra.distributed.impl.DistributedTestSnitch.getDatacenter(DistributedTestSnitch.java:90)
>   at 
> org.apache.cassandra.distributed.impl.DistributedTestSnitch.getDatacenter(DistributedTestSnitch.java:85)
>   at 
> org.apache.cassandra.locator.DynamicEndpointSnitch.getDatacenter(DynamicEndpointSnitch.java:118)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:488)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.(DatabaseDescriptor.java:137)
>   at 
> org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:102)
>   at 
> org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:60)
>   at org.apache.cassandra.io.util.FileUtils.(FileUtils.java:78)
>   at 
> org.apache.cassandra.distributed.impl.Instance.lambda$startup$7(Instance.java:509)
> {code}
> The exception isn’t clear, but what is happening is the following
> {code}
> static
> {
> boolean canClean = false;
> try
> {
> ByteBuffer buf = ByteBuffer.allocateDirect(1);
> ((DirectBuffer) buf).cleaner().clean();
> canClean = true;
> }
> catch (Throwable t)
> {
> JVMStabilityInspector.inspectThrowable(t);
> logger.info("Cannot initialize un-mmaper.  (Are you using a 
> non-Ora

[jira] [Updated] (CASSANDRA-16002) jvm upgrade dtests fail on java 11 caused by bad initialization order of DatabaseDescriptor and FileUtils

2020-07-30 Thread David Capwell (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-16002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Capwell updated CASSANDRA-16002:
--
Test and Documentation Plan: manual testing
 Status: Patch Available  (was: Open)

> jvm upgrade dtests fail on java 11 caused by bad initialization order of 
> DatabaseDescriptor and FileUtils
> -
>
> Key: CASSANDRA-16002
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16002
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/dtest
>Reporter: David Capwell
>Assignee: David Capwell
>Priority: Normal
> Fix For: 3.0.x, 3.11.x, 4.0-beta
>
>
> In FileUtils we check to see if we have access to some classes (specifically 
> to set org.apache.cassandra.io.util.FileUtils#isCleanerAvailable), which can 
> fail in java 11.  This is fine with CassandraDaemon as it will just log the 
> failure, but in in-jvm dtests this can fail to startup an instance with the 
> following
> {code}
> java.lang.RuntimeException: java.lang.RuntimeException: 
> java.lang.AssertionError: network topology must be assigned before using 
> snitch
>   at 
> org.apache.cassandra.distributed.impl.IsolatedExecutor.waitOn(IsolatedExecutor.java:209)
>   at 
> org.apache.cassandra.distributed.impl.IsolatedExecutor.lambda$sync$7(IsolatedExecutor.java:112)
>   at 
> org.apache.cassandra.distributed.impl.Instance.startup(Instance.java:592)
>   at 
> org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.startup(AbstractCluster.java:209)
>   at 
> org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.startup(AbstractCluster.java:200)
>   at 
> org.apache.cassandra.distributed.upgrade.UpgradeTestBase$TestCase.run(UpgradeTestBase.java:179)
>   at 
> org.apache.cassandra.distributed.upgrade.UpgradeTest.upgradeTest(UpgradeTest.java:50)
>   at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> Caused by: java.lang.RuntimeException: java.lang.AssertionError: network 
> topology must be assigned before using snitch
>   at 
> org.apache.cassandra.distributed.impl.Instance.lambda$startup$7(Instance.java:590)
>   at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
>   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>   at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>   at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>   at 
> org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:83)
>   at java.base/java.lang.Thread.run(Thread.java:834)
> Caused by: java.lang.AssertionError: network topology must be assigned before 
> using snitch
>   at 
> org.apache.cassandra.distributed.impl.DistributedTestSnitch.getDatacenter(DistributedTestSnitch.java:90)
>   at 
> org.apache.cassandra.distributed.impl.DistributedTestSnitch.getDatacenter(DistributedTestSnitch.java:85)
>   at 
> org.apache.cassandra.locator.DynamicEndpointSnitch.getDatacenter(DynamicEndpointSnitch.java:118)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:488)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.(DatabaseDescriptor.java:137)
>   at 
> org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:102)
>   at 
> org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:60)
>   at org.apache.cassandra.io.util.FileUtils.(FileUtils.java:78)
>   at 
> org.apache.cassandra.distributed.impl.Instance.lambda$startup$7(Instance.java:509)
> {code}
> The exception isn’t clear, but what is happening is the following
> {code}
> static
> {
> boolean canClean = false;
> try
> {
> ByteBuffer buf = ByteBuffer.allocateDirect(1);
> ((DirectBuffer) buf).cleaner().clean();
> canClean = true;
> }
> catch (Throwable t)
> {
> JVMStabilityInspector.inspectThrowable(t);
> logger.info("Cannot initialize un-mmaper.  (Are you using a 
> non-Oracle JVM?)  Compacted data files will not be removed promptly.  
> Consider using an Oracle JVM or using standard disk access mode");
> }
> canCleanDirectBuffers = canClean;
> }
> {code}
> JVMStabilityInspector will check the throwable which will eventually call 
> org.apa

[jira] [Updated] (CASSANDRA-16002) jvm upgrade dtests fail on java 11 caused by bad initialization order of DatabaseDescriptor and FileUtils

2020-07-30 Thread David Capwell (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-16002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Capwell updated CASSANDRA-16002:
--
 Bug Category: Parent values: Correctness(12982)Level 1 values: Test 
Failure(12990)
   Complexity: Low Hanging Fruit
Discovered By: Unit Test
Fix Version/s: 4.0-beta
   3.11.x
   3.0.x
 Severity: Normal
   Status: Open  (was: Triage Needed)

> jvm upgrade dtests fail on java 11 caused by bad initialization order of 
> DatabaseDescriptor and FileUtils
> -
>
> Key: CASSANDRA-16002
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16002
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/dtest
>Reporter: David Capwell
>Assignee: David Capwell
>Priority: Normal
> Fix For: 3.0.x, 3.11.x, 4.0-beta
>
>
> In FileUtils we check to see if we have access to some classes (specifically 
> to set org.apache.cassandra.io.util.FileUtils#isCleanerAvailable), which can 
> fail in java 11.  This is fine with CassandraDaemon as it will just log the 
> failure, but in in-jvm dtests this can fail to startup an instance with the 
> following
> {code}
> java.lang.RuntimeException: java.lang.RuntimeException: 
> java.lang.AssertionError: network topology must be assigned before using 
> snitch
>   at 
> org.apache.cassandra.distributed.impl.IsolatedExecutor.waitOn(IsolatedExecutor.java:209)
>   at 
> org.apache.cassandra.distributed.impl.IsolatedExecutor.lambda$sync$7(IsolatedExecutor.java:112)
>   at 
> org.apache.cassandra.distributed.impl.Instance.startup(Instance.java:592)
>   at 
> org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.startup(AbstractCluster.java:209)
>   at 
> org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.startup(AbstractCluster.java:200)
>   at 
> org.apache.cassandra.distributed.upgrade.UpgradeTestBase$TestCase.run(UpgradeTestBase.java:179)
>   at 
> org.apache.cassandra.distributed.upgrade.UpgradeTest.upgradeTest(UpgradeTest.java:50)
>   at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> Caused by: java.lang.RuntimeException: java.lang.AssertionError: network 
> topology must be assigned before using snitch
>   at 
> org.apache.cassandra.distributed.impl.Instance.lambda$startup$7(Instance.java:590)
>   at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
>   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>   at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>   at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>   at 
> org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:83)
>   at java.base/java.lang.Thread.run(Thread.java:834)
> Caused by: java.lang.AssertionError: network topology must be assigned before 
> using snitch
>   at 
> org.apache.cassandra.distributed.impl.DistributedTestSnitch.getDatacenter(DistributedTestSnitch.java:90)
>   at 
> org.apache.cassandra.distributed.impl.DistributedTestSnitch.getDatacenter(DistributedTestSnitch.java:85)
>   at 
> org.apache.cassandra.locator.DynamicEndpointSnitch.getDatacenter(DynamicEndpointSnitch.java:118)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:488)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.(DatabaseDescriptor.java:137)
>   at 
> org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:102)
>   at 
> org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:60)
>   at org.apache.cassandra.io.util.FileUtils.(FileUtils.java:78)
>   at 
> org.apache.cassandra.distributed.impl.Instance.lambda$startup$7(Instance.java:509)
> {code}
> The exception isn’t clear, but what is happening is the following
> {code}
> static
> {
> boolean canClean = false;
> try
> {
> ByteBuffer buf = ByteBuffer.allocateDirect(1);
> ((DirectBuffer) buf).cleaner().clean();
> canClean = true;
> }
> catch (Throwable t)
> {
> JVMStabilityInspector.inspectThrowable(t);
> logger.info("Cannot initialize un-mmaper.  (Are you using a 
> non-Oracle JVM?)  Compacted data files will not be removed promptly.  
> Consider using an