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

Main 5.0 jdk22 testing DO NOT COMMIT DO NOT REVIEW JUST IGNORE IT #1313

Draft
wants to merge 17 commits into
base: main-5.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .build/parent-pom-template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
</license>
</licenses>
<properties>
<bytebuddy.version>1.12.13</bytebuddy.version>
<byteman.version>4.0.20</byteman.version>
<bytebuddy.version>1.14.17</bytebuddy.version>
<byteman.version>4.0.23</byteman.version>
<ohc.version>0.5.1</ohc.version>

<!-- These are referenced in build.xml, so need to be propagated from there -->
Expand Down Expand Up @@ -486,13 +486,13 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.7.0</version>
<version>5.12.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>4.7.0</version>
<version>5.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -734,7 +734,7 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.96.Final</version>
<version>4.1.110.Final</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
Expand Down Expand Up @@ -805,28 +805,28 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>2.0.61.Final</version>
<version>2.0.65.Final</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>1.76</version>
<version>1.78.1</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>4.1.96.Final</version>
<version>4.1.110.Final</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>4.1.96.Final</version>
<version>4.1.110.Final</version>
<classifier>linux-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>4.1.96.Final</version>
<version>4.1.110.Final</version>
<classifier>linux-aarch_64</classifier>
</dependency>

Expand Down Expand Up @@ -1065,7 +1065,7 @@
<dependency>
<groupId>org.jctools</groupId>
<artifactId>jctools-core</artifactId>
<version>3.1.0</version>
<version>3.3.0</version>
</dependency>

<dependency>
Expand Down
14 changes: 9 additions & 5 deletions bin/cassandra.in.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ jvmver=`echo "$java_ver_output" | grep '[openjdk|java] version' | awk -F'"' 'NR=
JVM_VERSION=${jvmver%_*}
short=$(echo "${jvmver}" | cut -c1-2)

JAVA_VERSION=17
JAVA_VERSION=22
if [ "$short" = "11" ] ; then
JAVA_VERSION=11
elif [ "$JVM_VERSION" \< "17" ] ; then
echo "DSE DB 5.0 requires Java 11 or Java 17."
elif [ "$short" = "17" ] ; then
JAVA_VERSION=17
elif [ "$JVM_VERSION" \< "22" ] ; then
echo "DSE DB 5.0 requires Java 11, Java 17 or Java 22."
exit 1;
fi

Expand All @@ -149,9 +151,11 @@ case "$jvm" in
;;
esac

# Read user-defined JVM options from jvm-server.options file
# Read user-defined JVM options from jvm-clients.options file
JVM_OPTS_FILE=$CASSANDRA_CONF/jvm${jvmoptions_variant:--clients}.options
if [ $JAVA_VERSION -ge 17 ] ; then
if [ $JAVA_VERSION -ge 22 ] ; then
JVM_DEP_OPTS_FILE=$CASSANDRA_CONF/jvm22${jvmoptions_variant:--clients}.options
elif [ $JAVA_VERSION -ge 17 ] ; then
JVM_DEP_OPTS_FILE=$CASSANDRA_CONF/jvm17${jvmoptions_variant:--clients}.options
elif [ $JAVA_VERSION -ge 11 ] ; then
JVM_DEP_OPTS_FILE=$CASSANDRA_CONF/jvm11${jvmoptions_variant:--clients}.options
Expand Down
106 changes: 105 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
The use of both CASSANDRA_USE_JDK11 and use-jdk11 is deprecated.
-->
<property name="java.default" value="11" />
<property name="java.supported" value="11,17" />
<property name="java.supported" value="11,17,22" />

<!-- directory details -->
<property name="basedir" value="."/>
Expand Down Expand Up @@ -308,6 +308,7 @@
<string>--add-opens java.base/java.lang=ALL-UNNAMED</string>
<string>--add-opens java.base/java.util=ALL-UNNAMED</string>
<string>--add-opens java.base/java.nio=ALL-UNNAMED</string>
<string>--add-opens java.base/java.nio.file.attribute=ALL-UNNAMED</string>

<string>--add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED</string>
</resources>
Expand All @@ -316,6 +317,77 @@
<equals arg1="${ant.java.version}" arg2="17"/>
</condition>

<resources id="_jvm22_arg_items">
<string>-XX:+UnlockDiagnosticVMOptions</string>
<string>-Djdk.attach.allowAttachSelf=true</string>
<string>-XX:+UseG1GC</string>
<string>-XX:+ParallelRefProcEnabled</string>
<!-- Below two are used in Cassandra, not in CNDB-->
<!--<string>-XX:MaxTenuringThreshold=1</string>
<string>-XX:G1HeapRegionSize=16m</string>-->
<string>-XX:G1RSetUpdatingPauseTimePercent=5</string>
<string>-XX:MaxGCPauseMillis=100</string>

<!-- Copy-paste for now these options from cndb/docker-entrypoint.sh; we will verify later whether we
want all of them for tests-->
<string>-XX:-RestrictContended</string>
<string>-XX:+UseThreadPriorities</string>
<string>-XX:+DebugNonSafepoints</string>
<string>-XX:+UseStringDeduplication</string>
<string>-XX:StringTableSize=1000003</string>
<string>-XX:+PerfDisableSharedMem</string>
<string>-XX:+AlwaysPreTouch</string>
<string>-XX:+UseTLAB</string>
<string>-XX:+ResizeTLAB</string>
<string>-XX:+UseNUMA</string>


<string>--add-exports java.base/jdk.internal.misc=ALL-UNNAMED</string>
<string>--add-exports java.base/jdk.internal.ref=ALL-UNNAMED</string>
<string>--add-exports java.base/jdk.internal.perf=ALL-UNNAMED</string>
<string>--add-exports java.base/sun.nio.ch=ALL-UNNAMED</string>
<string>--add-exports java.management.rmi/com.sun.jmx.remote.internal.rmi=ALL-UNNAMED</string>
<string>--add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED</string>
<string>--add-exports java.rmi/sun.rmi.server=ALL-UNNAMED</string>
<string>--add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming</string>
<string>--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</string>
<string>--add-exports jdk.unsupported/sun.misc=ALL-UNNAMED</string>

<string>--add-opens java.base/jdk.internal.module=ALL-UNNAMED</string>
<string>--add-opens java.base/jdk.internal.reflect=ALL-UNNAMED</string>
<string>--add-opens java.base/jdk.internal.loader=ALL-UNNAMED</string>
<string>--add-opens java.base/jdk.internal.ref=ALL-UNNAMED</string>
<string>--add-opens java.base/jdk.internal.math=ALL-UNNAMED</string>
<string>--add-opens java.base/java.math=ALL-UNNAMED</string>
<string>--add-opens jdk.management.jfr/jdk.management.jfr=ALL-UNNAMED</string>
<string>--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED</string>
<string>--add-opens jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED</string>
<string>--add-opens java.base/java.lang.module=ALL-UNNAMED</string>
<string>--add-opens java.base/java.net=ALL-UNNAMED</string>
<string>--add-opens java.base/java.io=ALL-UNNAMED</string>
<string>--add-opens java.base/sun.nio.ch=ALL-UNNAMED</string>
<string>--add-opens java.base/java.nio=ALL-UNNAMED</string>
<string>--add-opens java.base/java.nio.file.spi=ALL-UNNAMED</string>
<string>--add-opens java.base/java.lang=ALL-UNNAMED</string>
<string>--add-opens java.base/java.util=ALL-UNNAMED</string>
<string>--add-opens java.base/java.lang.reflect=ALL-UNNAMED</string>
<string>--add-opens jdk.compiler/com.sun.tools.javac=ALL-UNNAMED</string>

<!-- required for org.apache.cassandra.Util.getSupportedMTimeGranularity-->
<string>--add-opens java.base/java.nio.file.attribute=ALL-UNNAMED</string>

<!-- below was added in Cassandra only; check for what and whether we need it here
add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED-->

<!-- below 2 were added to support jamm and fix BatchCommitLogTest -->
<string>--add-opens java.base/java.util.concurrent=ALL-UNNAMED</string>
<string>--add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED</string>
</resources>
<pathconvert property="_jvm22_args_concat" refid="_jvm22_arg_items" pathsep=" "/>
<condition property="java-jvmargs" value="${_jvm22_args_concat}">
<equals arg1="${ant.java.version}" arg2="22"/>
</condition>

<!--
JVM arguments for tests.

Expand Down Expand Up @@ -343,6 +415,19 @@
<condition property="_std-test-jvmargs" value="${_jvm17_test_arg_items_concat}">
<equals arg1="${ant.java.version}" arg2="17"/>
</condition>
<resources id="_jvm22_test_arg_items">
<string>-Djava.security.manager=allow</string>
<string>-Dio.netty.tryReflectionSetAccessible=true</string>
<!-- Enable vector incubator feature (simd support)-->
<string>--add-modules jdk.incubator.vector</string>
</resources>
<pathconvert property="_jvm22_test_arg_items_concat" refid="_jvm22_test_arg_items" pathsep=" "/>
<condition property="_std-test-jvmargs" value="${_jvm11_test_arg_items_concat}">
<equals arg1="${ant.java.version}" arg2="11"/>
</condition>
<condition property="_std-test-jvmargs" value="${_jvm22_test_arg_items_concat}">
<equals arg1="${ant.java.version}" arg2="22"/>
</condition>

<!-- needed to compile org.apache.cassandra.utils.JMXServerUtils -->
<!-- needed to compile org.apache.cassandra.distributed.impl.Instance-->
Expand Down Expand Up @@ -1250,6 +1335,7 @@
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
</testmacro>
<fileset dir="${test.unit.src}" />
</target>
Expand All @@ -1267,6 +1353,7 @@
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<jvmarg value="-Xmx${maxMemory}"/>
<jvmarg value="-Dlogback.configurationFile=file://${test.logback.configurationFile}"/>
</testmacrohelper>
Expand All @@ -1292,6 +1379,7 @@
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.config=file:///${compressed_yaml}"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<jvmarg value="-Dlogback.configurationFile=file://${test.logback.configurationFile}"/>
</testmacrohelper>
</sequential>
Expand All @@ -1313,6 +1401,7 @@
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.config=file:///${cdc_yaml}"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<jvmarg value="-Dlogback.configurationFile=file://${test.logback.configurationFile}"/>
</testmacrohelper>
</sequential>
Expand All @@ -1336,6 +1425,7 @@
<jvmarg value="-Dcassandra.config=file:///${latest_yaml}"/>
<jvmarg value="-Dcassandra.test.storage_compatibility_mode=NONE"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<jvmarg value="-Dlogback.configurationFile=file://${test.logback.configurationFile}"/>
</testmacrohelper>
</sequential>
Expand All @@ -1358,6 +1448,7 @@
<jvmarg value="-Dcassandra.config=file:///${scm_none_yaml}"/>
<jvmarg value="-Dcassandra.test.storage_compatibility_mode=NONE"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<jvmarg value="-Dlogback.configurationFile=file://${test.logback.configurationFile}"/>
</testmacrohelper>
</sequential>
Expand All @@ -1375,6 +1466,7 @@
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.config.loader=org.apache.cassandra.OffsetAwareConfigurationLoader"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<jvmarg value="-Dcassandra.allow_cursor_compaction=false" />
<jvmarg value="-Dlogback.configurationFile=file://${test.logback.configurationFile}"/>
</testmacrohelper>
Expand All @@ -1397,6 +1489,7 @@
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.config=file:///${system_keyspaces_directory_yaml}"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<jvmarg value="-Dlogback.configurationFile=file://${test.logback.configurationFile}"/>
</testmacrohelper>
</sequential>
Expand All @@ -1413,6 +1506,7 @@
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.sai.latest.version=aa"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<jvmarg value="-Dlogback.configurationFile=file://${test.logback.configurationFile}"/>
</testmacrohelper>
</sequential>
Expand All @@ -1428,6 +1522,7 @@
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<jvmarg value="-Dlogback.configurationFile=file://\${test.logback.configurationFile}"/>
</testmacrohelper>
</sequential>
Expand Down Expand Up @@ -1458,6 +1553,7 @@
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
</testmacro>
</target>

Expand Down Expand Up @@ -1621,6 +1717,7 @@
<jvmarg value="-Dcassandra.memtable_row_overhead_computation_step=100"/>
<jvmarg value="-Dcassandra.test.use_prepared=${cassandra.test.use_prepared}"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<classpath>
<path refid="cassandra.classpath.test" />
<pathelement location="${test.classes}"/>
Expand Down Expand Up @@ -1667,6 +1764,7 @@
<jvmarg value="-Dcassandra.test.use_prepared=${cassandra.test.use_prepared}"/>
<jvmarg value="-Dcassandra.memtable_row_overhead_computation_step=100"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<classpath>
<path refid="cassandra.classpath.test" />
<pathelement location="${test.classes}"/>
Expand Down Expand Up @@ -1890,6 +1988,7 @@
<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<jvmarg value="-Xmx8G"/>
</testmacro>
</target>
Expand All @@ -1901,6 +2000,7 @@
<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
</testmacro>
</target>

Expand All @@ -1911,6 +2011,7 @@
<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<jvmarg value="-Dcassandra.debugrefcount=false"/>
<jvmarg value="-Dcassandra.test.simulator.determinismcheck=strict"/>
<jvmarg value="-Dcassandra.test.simulator.print_asm=${simulator.asm.print}" />
Expand All @@ -1937,6 +2038,7 @@
<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<jvmarg value="-Xmx8G"/>
</testmacro>
</target>
Expand All @@ -1953,6 +2055,7 @@
<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
<jvmarg value="-Xmx8G"/>
</testmacro>
</target>
Expand All @@ -1966,6 +2069,7 @@
<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
<jvmarg value="-Dcassandra.skip_sync=true" />
<jvmarg value="-Dnet.bytebuddy.experimental=true"/>
</testmacro>
</target>

Expand Down
3 changes: 3 additions & 0 deletions conf/jvm-server.options
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@
#-Xms4G
#-Xmx4G

# Need experimental bytebuddy for JDK21
-Dnet.bytebuddy.experimental

# Young generation size is automatically calculated by cassandra-env
# based on this formula: min(100 * num_cores, 1/4 * heap size)
#
Expand Down
2 changes: 1 addition & 1 deletion conf/jvm17-server.options
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
# Java 11 (and newer) GC logging options:
# See description of https://bugs.openjdk.java.net/browse/JDK-8046148 for details about the syntax
# The following is the equivalent to -XX:+PrintGCDetails -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M
-Xlog:gc=info,heap*=debug,age*=debug,safepoint=info,promotion*=debug:file=/var/log/cassandra/gc.log:time,uptime,pid,tid,level:filecount=10,filesize=10485760
#-Xlog:gc=info,heap*=debug,age*=debug,safepoint=info,promotion*=debug:file=/var/log/cassandra/gc.log:time,uptime,pid,tid,level:filecount=10,filesize=10485760

# Notes for Java 8 migration:
#
Expand Down
Loading