diff --git a/.build/parent-pom-template.xml b/.build/parent-pom-template.xml index b6f4b63e229f..b874c7a857c1 100644 --- a/.build/parent-pom-template.xml +++ b/.build/parent-pom-template.xml @@ -36,8 +36,8 @@ - 1.12.13 - 4.0.20 + 1.14.17 + 4.0.23 0.5.1 @@ -486,13 +486,13 @@ org.mockito mockito-core - 4.7.0 + 5.12.0 test org.mockito mockito-inline - 4.7.0 + 5.2.0 test @@ -734,7 +734,7 @@ io.netty netty-all - 4.1.96.Final + 4.1.110.Final io.netty @@ -805,28 +805,28 @@ io.netty netty-tcnative-boringssl-static - 2.0.61.Final + 2.0.65.Final org.bouncycastle bcpkix-jdk18on - 1.76 + 1.78.1 io.netty netty-transport-native-epoll - 4.1.96.Final + 4.1.110.Final io.netty netty-transport-native-epoll - 4.1.96.Final + 4.1.110.Final linux-x86_64 io.netty netty-transport-native-epoll - 4.1.96.Final + 4.1.110.Final linux-aarch_64 @@ -1065,7 +1065,7 @@ org.jctools jctools-core - 3.1.0 + 3.3.0 diff --git a/bin/cassandra.in.sh b/bin/cassandra.in.sh index 237f733ecf48..f6cb2e2efc2c 100644 --- a/bin/cassandra.in.sh +++ b/bin/cassandra.in.sh @@ -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 @@ -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 diff --git a/build.xml b/build.xml index 3f9fecb6c77a..069d42a9327d 100644 --- a/build.xml +++ b/build.xml @@ -45,7 +45,7 @@ The use of both CASSANDRA_USE_JDK11 and use-jdk11 is deprecated. --> - + @@ -308,6 +308,7 @@ --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED + --add-opens java.base/java.nio.file.attribute=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED @@ -316,6 +317,77 @@ + + -XX:+UnlockDiagnosticVMOptions + -Djdk.attach.allowAttachSelf=true + -XX:+UseG1GC + -XX:+ParallelRefProcEnabled + + + -XX:G1RSetUpdatingPauseTimePercent=5 + -XX:MaxGCPauseMillis=100 + + + -XX:-RestrictContended + -XX:+UseThreadPriorities + -XX:+DebugNonSafepoints + -XX:+UseStringDeduplication + -XX:StringTableSize=1000003 + -XX:+PerfDisableSharedMem + -XX:+AlwaysPreTouch + -XX:+UseTLAB + -XX:+ResizeTLAB + -XX:+UseNUMA + + + --add-exports java.base/jdk.internal.misc=ALL-UNNAMED + --add-exports java.base/jdk.internal.ref=ALL-UNNAMED + --add-exports java.base/jdk.internal.perf=ALL-UNNAMED + --add-exports java.base/sun.nio.ch=ALL-UNNAMED + --add-exports java.management.rmi/com.sun.jmx.remote.internal.rmi=ALL-UNNAMED + --add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED + --add-exports java.rmi/sun.rmi.server=ALL-UNNAMED + --add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming + --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + --add-exports jdk.unsupported/sun.misc=ALL-UNNAMED + + --add-opens java.base/jdk.internal.module=ALL-UNNAMED + --add-opens java.base/jdk.internal.reflect=ALL-UNNAMED + --add-opens java.base/jdk.internal.loader=ALL-UNNAMED + --add-opens java.base/jdk.internal.ref=ALL-UNNAMED + --add-opens java.base/jdk.internal.math=ALL-UNNAMED + --add-opens java.base/java.math=ALL-UNNAMED + --add-opens jdk.management.jfr/jdk.management.jfr=ALL-UNNAMED + --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED + --add-opens jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED + --add-opens java.base/java.lang.module=ALL-UNNAMED + --add-opens java.base/java.net=ALL-UNNAMED + --add-opens java.base/java.io=ALL-UNNAMED + --add-opens java.base/sun.nio.ch=ALL-UNNAMED + --add-opens java.base/java.nio=ALL-UNNAMED + --add-opens java.base/java.nio.file.spi=ALL-UNNAMED + --add-opens java.base/java.lang=ALL-UNNAMED + --add-opens java.base/java.util=ALL-UNNAMED + --add-opens java.base/java.lang.reflect=ALL-UNNAMED + --add-opens jdk.compiler/com.sun.tools.javac=ALL-UNNAMED + + + --add-opens java.base/java.nio.file.attribute=ALL-UNNAMED + + + + + --add-opens java.base/java.util.concurrent=ALL-UNNAMED + --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED + + + + + + + --add-modules jdk.incubator.vector + + + + + + + + @@ -1250,6 +1335,7 @@ + @@ -1267,6 +1353,7 @@ + @@ -1292,6 +1379,7 @@ + @@ -1313,6 +1401,7 @@ + @@ -1336,6 +1425,7 @@ + @@ -1358,6 +1448,7 @@ + @@ -1375,6 +1466,7 @@ + @@ -1397,6 +1489,7 @@ + @@ -1413,6 +1506,7 @@ + @@ -1428,6 +1522,7 @@ + @@ -1458,6 +1553,7 @@ + @@ -1621,6 +1717,7 @@ + @@ -1667,6 +1764,7 @@ + @@ -1890,6 +1988,7 @@ + @@ -1901,6 +2000,7 @@ + @@ -1911,6 +2011,7 @@ + @@ -1937,6 +2038,7 @@ + @@ -1953,6 +2055,7 @@ + @@ -1966,6 +2069,7 @@ + diff --git a/conf/jvm-server.options b/conf/jvm-server.options index c50f3631f5a0..94b50c89bd0a 100644 --- a/conf/jvm-server.options +++ b/conf/jvm-server.options @@ -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) # diff --git a/conf/jvm17-server.options b/conf/jvm17-server.options index e054847ed640..23ddb84a6415 100644 --- a/conf/jvm17-server.options +++ b/conf/jvm17-server.options @@ -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: # diff --git a/conf/jvm22-clients.options b/conf/jvm22-clients.options new file mode 100644 index 000000000000..6e30351a77ee --- /dev/null +++ b/conf/jvm22-clients.options @@ -0,0 +1,31 @@ +########################################################################### +# jvm22-clients.options # +# # +# See jvm-clients.options. This file is specific for Java 22 and newer. # +########################################################################### + +################### +# JPMS SETTINGS # +################### + +-Djdk.attach.allowAttachSelf=true +--add-exports java.base/jdk.internal.misc=ALL-UNNAMED +--add-exports java.base/jdk.internal.ref=ALL-UNNAMED +--add-exports java.base/sun.nio.ch=ALL-UNNAMED +--add-exports java.management.rmi/com.sun.jmx.remote.internal.rmi=ALL-UNNAMED +--add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED +--add-exports java.rmi/sun.rmi.server=ALL-UNNAMED +--add-exports java.sql/java.sql=ALL-UNNAMED + +--add-opens java.base/java.lang.module=ALL-UNNAMED +--add-opens java.base/jdk.internal.loader=ALL-UNNAMED +--add-opens java.base/jdk.internal.ref=ALL-UNNAMED +--add-opens java.base/jdk.internal.reflect=ALL-UNNAMED +--add-opens java.base/jdk.internal.math=ALL-UNNAMED +--add-opens java.base/jdk.internal.module=ALL-UNNAMED +--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED +--add-opens=java.base/java.lang.reflect=ALL-UNNAMED +--add-opens java.base/java.io=ALL-UNNAMED +--add-opens java.base/sun.nio.ch=ALL-UNNAMED + +# The newline in the end of file is intentional \ No newline at end of file diff --git a/conf/jvm22-server.options b/conf/jvm22-server.options new file mode 100644 index 000000000000..b46df5fc5fe3 --- /dev/null +++ b/conf/jvm22-server.options @@ -0,0 +1,126 @@ +########################################################################### +# jvm22-server.options # +# # +# See jvm-server.options. This file is specific for Java 22 and newer. # +########################################################################### + +################# +# GC SETTINGS # +################# + + + +### CMS Settings +#-XX:+UseConcMarkSweepGC +#-XX:+CMSParallelRemarkEnabled +#-XX:SurvivorRatio=8 +#-XX:MaxTenuringThreshold=1 +#-XX:CMSInitiatingOccupancyFraction=75 +#-XX:+UseCMSInitiatingOccupancyOnly +#-XX:CMSWaitDuration=10000 +#-XX:+CMSParallelInitialMarkEnabled +#-XX:+CMSEdenChunksRecordAlways +## some JVMs will fill up their heap when accessed via JMX, see CASSANDRA-6541 +#-XX:+CMSClassUnloadingEnabled + + + +### G1 Settings +## Use the Hotspot garbage-first collector. +-XX:+UseG1GC +-XX:+ParallelRefProcEnabled + +# +## Have the JVM do less remembered set work during STW, instead +## preferring concurrent GC. Reduces p99.9 latency. +-XX:G1RSetUpdatingPauseTimePercent=5 +# +## Main G1GC tunable: lowering the pause target will lower throughput and vise versa. +## 200ms is the JVM default and lowest viable setting +## 1000ms increases throughput. Keep it smaller than the timeouts in cassandra.yaml. +-XX:MaxGCPauseMillis=500 + +## Optional G1 Settings +# Save CPU time on large (>= 16GB) heaps by delaying region scanning +# until the heap is 70% full. The default in Hotspot 8u40 is 40%. +#-XX:InitiatingHeapOccupancyPercent=70 + +# For systems with > 8 cores, the default ParallelGCThreads is 5/8 the number of logical cores. +# Otherwise equal to the number of cores when 8 or less. +# Machines with > 10 cores should try setting these to <= full cores. +#-XX:ParallelGCThreads=16 +# By default, ConcGCThreads is 1/4 of ParallelGCThreads. +# Setting both to the same value can reduce STW durations. +#-XX:ConcGCThreads=16 + + +### JPMS + +-Djdk.attach.allowAttachSelf=true +--add-exports java.base/jdk.internal.misc=ALL-UNNAMED +--add-exports java.base/jdk.internal.ref=ALL-UNNAMED +--add-exports java.base/jdk.internal.perf=ALL-UNNAMED +--add-exports java.base/sun.nio.ch=ALL-UNNAMED +--add-exports java.management.rmi/com.sun.jmx.remote.internal.rmi=ALL-UNNAMED +--add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED +--add-exports java.rmi/sun.rmi.server=ALL-UNNAMED +# --add-exports java.sql/java.sql=ALL-UNNAMED --> not seen in +# Below exist in the other script +--add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming +--add-exports jdk.unsupported/sun.misc=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + +--add-opens java.base/jdk.internal.loader=ALL-UNNAMED +--add-opens java.base/jdk.internal.ref=ALL-UNNAMED +--add-opens java.base/jdk.internal.reflect=ALL-UNNAMED +--add-opens java.base/jdk.internal.math=ALL-UNNAMED +--add-opens java.base/jdk.internal.module=ALL-UNNAMED +--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED +# Added in +--add-opens java.base/java.lang.module=ALL-UNNAMED +--add-opens jdk.management.jfr/jdk.management.jfr=ALL-UNNAMED +--add-opens jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED +--add-opens jdk.compiler/com.sun.tools.javac=ALL-UNNAMED +--add-opens java.base/java.nio.file.spi=ALL-UNNAMED +--add-opens java.base/java.net=ALL-UNNAMED +--add-opens java.base/jdk.internal.math=ALL-UNNAMED +--add-opens java.base/java.lang.reflect=ALL-UNNAMED + +# required for org.apache.cassandra.Util.getSupportedMTimeGranularity +--add-opens java.base/java.nio.file.attribute=ALL-UNNAMED + + +### GC logging options -- uncomment to enable + +# 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 + +# Notes for Java 8 migration: +# +# -XX:+PrintGCDetails maps to -Xlog:gc*:... - i.e. add a '*' after "gc" +# -XX:+PrintGCDateStamps maps to decorator 'time' +# +# -XX:+PrintHeapAtGC maps to 'heap' with level 'trace' +# -XX:+PrintTenuringDistribution maps to 'age' with level 'debug' +# -XX:+PrintGCApplicationStoppedTime maps to 'safepoint' with level 'info' +# -XX:+PrintPromotionFailure maps to 'promotion' with level 'trace' +# -XX:PrintFLSStatistics=1 maps to 'freelist' with level 'trace' + +### Netty Options + +# On Java >= 9 Netty requires the io.netty.tryReflectionSetAccessible system property to be set to true to enable +# creation of direct buffers using Unsafe. Without it, this falls back to ByteBuffer.allocateDirect which has +# inferior performance and risks exceeding MaxDirectMemory +-Dio.netty.tryReflectionSetAccessible=true + +### Enable vector incubator feature (simd support) + +--add-modules jdk.incubator.vector + +### Compatibility Options +--add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED +-Djava.security.manager=allow + +# The newline in the end of file is intentional \ No newline at end of file diff --git a/ide/idea/workspace.xml b/ide/idea/workspace.xml index 8337c5eee7b9..6e38eef56033 100644 --- a/ide/idea/workspace.xml +++ b/ide/idea/workspace.xml @@ -151,6 +151,7 @@ -Dcassandra.storagedir=$PROJECT_DIR$/data -Djava.library.path=$PROJECT_DIR$/lib/sigar-bin -Dlogback.configurationFile=file://$PROJECT_DIR$/conf/logback.xml + -Dnet.bytebuddy.experimental=true -XX:HeapDumpPath=build/test -ea" />