Aaronontheweb
Aaronontheweb

Reputation: 8414

Cassandra 2.0 - CQL3 schema changes not propagated through rest of cluster even after 30+ minutes

I created a table in CQL 3.0 / Cassandra 1.2 a few months ago with a pretty simple table structure that included a couple of columns with CQL3 collections.

Today I rolled out an update to the schema for that table on our development C* cluster, which has since been upgraded to Cassandra 2.0 running CQL 3.1.

I ran the following command via cqlsh on one of the 4 nodes in our ring today: ALTER TABLE ExistingTable DROP OldColumn1; ALTER TABLE ExistingTable DROP OldColumn1_; --used for DSE Search solr indexing; no longer needed ALTER TABLE ExistingTable ADD NewColumn set<uuid>;

However, after 30 minutes I was seeing some failing tests from our application and was pretty surprised to see that while the node I ran these changes on had the correct schema, none of these changes were ever propagated to its peers in the ring. I've been using Cassandra for a year and a half and have never seen this before.

How can I fix this and what caused the issue?

Edit This might help explain what's going on. Got the following error when I tried to kick off a nodetool repair:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/cassandra/tools/NodeCmd : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: org.apache.cassandra.tools.NodeCmd. Program will exit.

Upvotes: 0

Views: 990

Answers (2)

Aaronontheweb
Aaronontheweb

Reputation: 8414

I followed Christopher's suggestion and fixed my JDK issue with nodetool / dse tool. Cassandra worked because looks for a symbolic link to the "java" command, which was correctly set to JRE 7 during the upgrade to Oracle JDK7, and uses that to run its jars. All of the command line tools except for cqlsh, however, all depend on the JAVA_HOME environment variable, which was incorrectly set to Java 6. That's why Cassandra 2.0 could run but nodetool could not.

After fixing that issue my schema replicated instantly to other nodes once I re-applied my schema changes to a different node.

Upvotes: 2

Christopher Smith
Christopher Smith

Reputation: 5542

You're code was compiled for JDK 7, and you are running on JDK 6.

Upvotes: 1

Related Questions