0

In our java application version 1 which is using cassandra 2.1

At startup we are executing query : "*SELECT * from system.schema_keyspaces;*" to get keyspace info (if this fails application wont start)

However new code we are getting the keypspace information from driver's cluster.metadata instance which is using cassandra 3.11

We are using DC aware RoundRobin load balancing policy of java datastax driver.

Now consider a scenario with upgrade of 3 nodes : A,B and C, where A is upgraded (new application + Cassandra 3.11), upgrade on B is under process (Cassandra is down here) and C is not upgraded (old application + Cassandra 2.1). and your client application on C node restarts.

I am getting InvalidQueryException if the old query present on java client of C node gets executed on A (as client will send query in round robin way). if it fails there is no handling in old application. How can we resolve this issue ?

com.datastax.driver.core.exceptions.InvalidQueryException: un-configured table schema_keyspaces

One way i figured out that remove A's Ip from contact points of client application + peers table on C Cassandra node . Now Restart the client application. and then Cassandra to restore peers table entry.

Other way is keep restarting the client application on C until client application query actually hit the Cassandra 2.1 and successfully restarts. But that seems ugly to me.

1 Answer 1

0

In your application it's better to explicitly set protocol version to match Cassandra 2.1, instead of trying to rely on auto-negotiation features. Driver's documentation explicitly says about this.

According the compatibility matrix you need to explicitly set protocol version to V3, but this also depends on the driver version, so you may need to stuck to version 2.

Cluster cluster = Cluster.builder()
    .addContactPoint("xxxx")
    .withProtocolVersion(ProtocolVersion.V3)
    .build();

After upgrade to 3.11 is done you can switch to protocol version 4.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks Alex for your reply, The problem is in our latest version code we have provision to configure the native protocol version, and during upgrade we make sure that upgraded node should use protocol version 3 only and not 4 , but don't have the same configuration in old code..and we cant change the old deployed code.
yeah, then it's problem - so you need to keep it restarting, but I don't remember, if in the older versions of driver, the shuffling of the contact points happens or not. You can check this ticket: datastax-oss.atlassian.net/browse/JAVA-618 - if you're using driver with version lower than 2.0.11, then you will need to change the contact points in the old application.
Our driver version is >2.0..and I have tested the suffling feature by restarting...on 6th restart my app was successfully up :p... although it is frustrating but it works

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.