1

I have upgraded one of cluster node from 2.2.19 to 3.11.13, but I'm continuously getting the below error in system logs. I'm using TimeWindowCompactionStrategy-3.7.jar

Please let me know how can I fix this error ?

ERROR [CompactionExecutor:2338] 2022-09-12 14:40:41,310 CassandraDaemon.java:244 - Exception in thread Thread[CompactionExecutor:2338,1,main]
java.lang.NoSuchMethodError: org.apache.cassandra.db.ColumnFamilyStore.getOverlappingSSTables(Lorg/apache/cassandra/db/lifecycle/SSTableSet;Ljava/lang/Iterable;)Ljava/util/Collection;
    at com.jeffjirsa.cassandra.db.compaction.TimeWindowCompactionStrategy.getNextBackgroundSSTables(TimeWindowCompactionStrategy.java:110)
    at com.jeffjirsa.cassandra.db.compaction.TimeWindowCompactionStrategy.getNextBackgroundTask(TimeWindowCompactionStrategy.java:79)
    at org.apache.cassandra.db.compaction.CompactionStrategyManager.getNextBackgroundTask(CompactionStrategyManager.java:154)
    at org.apache.cassandra.db.compaction.CompactionManager$BackgroundCompactionCandidate.run(CompactionManager.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:84)
    at java.lang.Thread.run(Thread.java:750) 
Aaron
  • 55,518
  • 11
  • 116
  • 132
Solver
  • 11
  • 1

1 Answers1

1

TimeWindowCompactionStrategy has been merged into Apache Cassandra 3.11.13, so you shouldn't need to include the JAR for it. Remove the JAR file and restart the node(s).

Edit

Ok, after a quick conversation with Jeff, he has two suggestions:

The 3.7 jar won't be compatible with 3.11. So issue the ALTER TABLE syntax on the 3.11 node, which will use the TWCS version bundled with 3.11. It'll not propagate to the 2.2 hosts (because schema changes won't cross major versions).

You'll be in a schema disagreement state, but that should be ok until the upgrade is complete. Give that a try in a lower environment, just to make sure it works.

The other option is to take the version of TWCS from 3.11, rename it with the right classpath to use com.jeffjirsa, and just use that instead.

Edit

Protocol exception with client networking: org.apache.cassandra.transport.ProtocolException: Invalid or unsupported protocol version (4); supported versions are (3/v3, 4/v4, 5/v5-beta)

Is the error due to the mixed versions in the cluster ?

Yes! I've seen that happen before. You can actually force a protocol version in the driver's connection settings.

Best of luck!

Aaron
  • 55,518
  • 11
  • 116
  • 132
  • I have my TWCS tables using TimeWindowCompactionStrategy-2.2.5.jar in 2.2.19 version, I cannot alter the tables to 'class': 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy' until I upgrade the version of all the nodes in the cluster. Hence what is the TimeWindowCompactionStrategy jar file I need to add until the upgrade is completed on the nodes (after which I can alter the TWCS tables) so that I don't hit the error ? – Solver Sep 12 '22 at 19:28
  • @Solver Ok, I've pinged the author of TimeWindowCompactionStrategy (Jeff Jirsa), so I'm hoping he'll jump in with a path forward. – Aaron Sep 12 '22 at 19:47
  • Thanks for the update. I have tried with option 1, to alter TWCS Tables on the upgraded node with 3.11 version and this worked. – Solver Sep 15 '22 at 15:27
  • Also, I see below warning in logs. App is using 3.x datastax driver protocol version v4, which should be compatible with 3.11 Cassandra. Please let me know why I still see these warning and how to fix it ? Protocol exception with client networking: org.apache.cassandra.transport.ProtocolException: Invalid or unsupported protocol version (4); supported versions are (3/v3, 4/v4, 5/v5-beta) – Solver Sep 15 '22 at 15:34
  • @Solver That...is...weird. Are you explicitly setting it? Or is it "negotiating" that protocol version? – Aaron Sep 15 '22 at 17:20
  • The datastax driver version is 3.11 and I guess the protocol version is negotiated at the backend. Is the error due to the mixed versions in the cluster ? I mean once the entire cluster is upgraded to the new version , the driver might pick a stable version ? – Solver Sep 15 '22 at 19:19
  • @Solver edit made. – Aaron Sep 15 '22 at 19:41