-
Notifications
You must be signed in to change notification settings - Fork 22
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
CNDB-11508 main-5.0 branch #1408
base: main-5.0
Are you sure you want to change the base?
Conversation
CI is in a bad shape today going up and down and I am not being able to really check test results. |
889f389
to
890af4b
Compare
conf/jvm-server.options
Outdated
@@ -171,6 +171,9 @@ | |||
#-Xms4G | |||
#-Xmx4G | |||
|
|||
# Need experimental bytebuddy for JDK21 | |||
-Dnet.bytebuddy.experimental |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just upgrade to a newer byte buddy? JDK 22 is officially supported in 1.14.9 and the latest 1.15.10 supports up to jdk24.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually we are already using 1.14.17 which supports up to JDK 23. So we should not need this already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it because our tests showed we need it -
https://jenkins-stargazer.aws.dsinternal.org/job/ds-cassandra-build/867/#showFailuresLink and https://jenkins-stargazer.aws.dsinternal.org/job/ds-cassandra-build/867/testReport/junit/org.apache.cassandra.cache/ChunkCacheInterceptingTest/tests_stage_1___jvm_unit_tests___jvm_unit_compression_tests___testChunkCacheInterception_compression_jdk22/
I believe our friend mockito-inline was to be blamed here. Tatu had the same issues with Stargate, if I remember correctly.
I believe the last I tried a few months ago the latest version did not work with mockito-inline so I had to downgrade and adjust versions in the POC branch. Maybe something has changed since than, so I suggest we open a follow up ticket for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this is jvm-server.options
which is not used in unit tests, is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, I don't think we actually needed. I will remove it and see if CI complains for some reason that I cannot recall now.
build.xml
Outdated
@@ -515,6 +606,7 @@ | |||
<jvmarg value="-Dstorage-config=${test.conf}"/> | |||
<jvmarg value="-Dcassandra.reads.thresholds.coordinator.defensive_checks_enabled=true" /> <!-- enable defensive checks --> | |||
<jvmarg value="-javaagent:${build.dir.lib}/jars/jamm-${jamm.version}.jar" /> | |||
<jvmarg value="-Dnet.bytebuddy.experimental=true"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
none of the byte buddy -D should be needed as we are using version 1.14.17 which supports up to JDK23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check this comment:
#1408 (comment)
Issues with mockito-inline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. we should remove all the byte buddy -D, they should not be needed. possibly upgrade to the latest byte buddy to prevent needing to touch it again later.
Thank you for the review!
Please check below comment: |
@@ -122,11 +122,16 @@ 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this correct and consistent with what we have in main
? I suggested to allow only LTS versions but eventually @JeremiahDJordan opposed and we allow for any >= 11; While here I can see 12..16 and 18..21 seem to be disallowed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a patch in trunk that adds a flag to be able to allow those. We should port it and not allow it by default. But let's not do it here?
This comment I wrote in the issue:
UPDATE: I will pull the patch from CASSANDRA-18688 in a separate ticket. We can add it when we fix all tests and enable main branch for testing with JDK22 in CI. Otherwise, there will be confusion that the branch is JDK22 ready when it is still not fully ready.
<string>--add-opens java.base/jdk.internal.reflect=ALL-UNNAMED</string> | ||
<string>--add-opens java.base/jdk.internal.vm=ALL-UNNAMED</string> | ||
<string>--add-opens java.base/sun.nio.ch=ALL-UNNAMED</string> | ||
<string>--add-opens jdk.compiler/com.sun.tools.javac=ALL-UNNAMED</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have similar thoughts as for main - we should leverage the fact we mostly extend the sets of exports and opens with newer JVM versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already responded on the other PR, it applies to this comment too:
#1398 (comment)
conf/jvm22-server.options
Outdated
--add-opens java.base/java.nio=ALL-UNNAMED | ||
--add-opens java.base/java.util=ALL-UNNAMED | ||
--add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED | ||
--add-opens java.base/sun.nio.ch=ALL-UNNAMED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly as in main
there are duplications
build.xml
Outdated
@@ -1247,6 +1340,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"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need to add it individually to each test configuration, to IntellliJ files, etc. - just add it to jdk22 props which are applied everywhere
@@ -790,7 +790,8 @@ TrieEntry<K, V> nextEntryImpl(TrieEntry<K, V> start, TrieEntry<K, V> previous, T | |||
* This is implemented by going always to the left until | |||
* we encounter a valid uplink. That uplink is the first key. | |||
*/ | |||
TrieEntry<K, V> firstEntry() | |||
// @Override needed in JDK 21+. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if @Override
is needed, then why don't you add it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it is needed only if we build on JDK21+. There is nothing to override on previous version and we still build on 11.
Feedback addressed. @jacek-lewandowski , I believe the main question here is: let me know what you want me to do with this one - #1398 (comment) |
* CNDB-11498: Compile on JDK22: - firstEntry() and lastEntry() were trying to assign weaker access privileges (e.g., private or package-private) when they need to be public according to the interface they are implementing (SequencedMap). - JDK 21+ adds SequencedCollection: The List and NavigableSet interfaces now inherit from a new interface called SequencedCollection, which introduces the reversed() method. However, NavigableSet.reversed() returns a NavigableSet, while List.reversed() returns a List. This results in a conflict, as the types are incompatible.
…roperties `java.default` and `java.supported`. ant generate-idea-files now support JDK 8, JDK 11 and JDK 22. To add support of another JDK the java-jvmargs property must be set for the JDK in question (see how it's done in build.xml for Java 11 and 22) Other minor, but notable changes are: - test jvmargs are now added to idea run configurations - .idea dir and project iml file are first removed and then recreated during `ant generate-idea-files` Based on what was done in CASSANDRA-18467, CASSANDRA-18179, CASSANDRA-18258 for 17 plus additional stuff for 21 Co-authored-by: Ekaterina Dimitrova<[email protected]> Co-authored-by: Mick Semb Wever <[email protected]> Co-authored-by: Jakub Zytka <[email protected]> Fix add-opens and add-exports CNDB-11508: CQLSHLIB tests update Fix EmptyValuesTest Fix sjk Fix tools/bin/cassandra.in.sh; fix some JDK internals openings for audit logger and vectorizedMismatch Upgrade Mockito to fix UnifiedCompactionStrategyTest Get rid of JDK8 in scripts, not supported anywhere anymore
…aybe we still want to check newer version for JDK22 specifically. Though this is the last ecj version to support JDK11. Upgrade: - ecj plus fix the java udf functions for JDK11+ - snakeyaml - it was already bumped in CNDB for security vulnerability - test dependencies: jacoco, byteman - higher version than CNDB but it is needed for catching up on JDK22 in tests findbugs - aligned with CNDB version but we probably want at some point to get to major version upgrade; not a priority for now jmh, bytebuddy - bumped to latest versions as they are known for not working on newer JDK versions
When running tests with JDK17 we see NoClassDefFoundError when trying to instante org.apache.cassandra.Util class due caused by getSupportedMTimeGranularity trying to access a private field. This patch modified the build configuration to add a jvm option allowing that access.
a4f42ec
to
a56afc0
Compare
Thank you for the reviews! There are a few conversations about how we can improve/change certain things like |
JDK11 CI finished successfully. Moving forward to the additional testing I will have to push manually. I publish links on the main issue. |
Quality Gate passedIssues Measures |
❌ Build ds-cassandra-pr-gate/PR-1408 rejected by Butler18 new test failure(s) in 6 builds Found 18 new test failuresShowing only first 15 new test failures
Found 3 known test failures |
What is the issue
We cannot:
main-5.0
on JDK22What does this PR fix and why was it fixed
...
main-5.0
branch. We also added numerous fixes that get CI to a very good state on JDK22. CI runs posted on the GH issue.Checklist before you submit for review
NoSpamLogger
for log lines that may appear frequently in the logs