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

docker: updates zipkin-cassandra test image to 4.1.8 #3794

Merged
merged 2 commits into from
Feb 16, 2025
Merged

Conversation

codefromthecrypt
Copy link
Member

@codefromthecrypt codefromthecrypt commented Feb 16, 2025

If you just update to 4.1.8 and change nothing else, you'll crash like this:

14.33 [2025-02-16 11:04:06,099] ERROR Exception encountered during startup (org.apache.cassandra.service.CassandraDaemon)
14.33 java.lang.UnsupportedOperationException: can't get field offset on a hidden class: private final org.apache.cassandra.db.ClusteringComparator org.apache.cassandra.db.ClusteringComparator$$Lambda/0x000000e0012f5220.arg$1
14.33 	at jdk.unsupported/sun.misc.Unsafe.objectFieldOffset(Unsafe.java:652)
14.33 	at org.github.jamm.MemoryLayoutSpecification.sizeOfInstanceWithUnsafe(MemoryLayoutSpecification.java:108)
14.33 	at org.github.jamm.MemoryLayoutSpecification.sizeOfWithUnsafe(MemoryLayoutSpecification.java:89)
14.33 	at org.github.jamm.MemoryMeter.measure(MemoryMeter.java:217)
14.33 	at org.github.jamm.MemoryMeter.measureDeep(MemoryMeter.java:259)
14.33 	at org.apache.cassandra.utils.ObjectSizes.measureDeep(ObjectSizes.java:219)
14.33 	at org.apache.cassandra.cql3.QueryProcessor.measurePstmnt(QueryProcessor.java:912)
14.33 	at org.apache.cassandra.cql3.QueryProcessor.parseAndPrepare(QueryProcessor.java:445)
14.33 	at org.apache.cassandra.cql3.QueryProcessor.prepareInternal(QueryProcessor.java:414)
14.33 	at org.apache.cassandra.cql3.QueryProcessor.executeInternal(QueryProcessor.java:452)
14.33 	at org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:1087)
14.33 	at org.apache.cassandra.service.StartupChecks$13.execute(StartupChecks.java:630)
14.33 	at org.apache.cassandra.service.StartupChecks.verify(StartupChecks.java:174)
14.33 	at org.apache.cassandra.service.CassandraDaemon.runStartupChecks(CassandraDaemon.java:499)
14.33 	at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:253)
14.33 	at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:744)
14.33 	at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:878)

This is due ultimately to needing to upgrade jamm, which had some signature drift. CASSANDRA-18329 fixes this in 5.0, but not in 4.1.

CASSANDRA-18329 fixed this particularly by updating call sites to jamm in ObjectSizes.java.

We use JRE 21 in our test image even though cassandra 4.1 doesn't really support it, to save base layers. The easiest way to fix this was to grab the ObjectSizes.java file from 5.0.3 and the revert their renaming of a public method so it could be a drop in patch.

wget --random-wait --tries=5 -qO ObjectSizes.java \
https://raw.githubusercontent.com/apache/cassandra/refs/tags/cassandra-5.0.3/src/java/org/apache/cassandra/utils/ObjectSizes.java
sed -i 's/sizeOnHeapExcludingDataOf/sizeOnHeapExcludingData/g' ObjectSizes.java
javac -cp 'lib/*' -d classes ObjectSizes.java
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this works as some time in the past we were already adding classes. So, "classes" is already in the run scripts else startup would fail.

@codefromthecrypt
Copy link
Member Author

security fail will resolve with #3793

@codefromthecrypt
Copy link
Member Author

@reta mind merging this one, too prior to release after any polishing you might want to do?

Signed-off-by: Adrian Cole <adrian.cole@elastic.co>
Signed-off-by: Adrian Cole <adrian.cole@elastic.co>
@reta reta merged commit d344596 into master Feb 16, 2025
14 checks passed
@reta reta deleted the cassandra-4.1.8 branch February 16, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants