I was doing a test of new Lagom 1.5.1 version using a simple service with cassandra and postgres (readside) persistence.
For the test I’m using cassandra 4 (I compiled it locally from cassandra’s git repository) and Java 11 (amazon-corretto-11.0.2.9.3).
The startup looked good and tables were created in postgress, unfortunately during cassandra’s keyspace initialization the following error arose:
java.util.concurrent.ExecutionException: com.datastax.driver.core.exceptions.InvalidQueryException: Clustering key columns must exactly match columns in CLUSTERING ORDER BY directive
And some of the tables weren’t created in cassandra’s keyspace.
For work with Cassandra 4.X need Cassandra Java Driver 4.x
Akka Persistence Cassandra until not support Cassandra Java Driver 4.x (issue#446). Need waiting release akka-persistence-cassandra#1.0.0.
Lagom use akka-persistence-cassandra#0.61. It has pr#1512 for upgrade, but I think that akka-persistence-cassandra will upgrade to 1.0.0 only in Lagom#1.6.0 (issue#1927)
Summary (IMHO): Before the release Lagom#1.6.0, he will not be able to support Cassandra 4.X.
Maybe somebody of maintainers (@ignasi35, @octonato) can share a roadmap of release 1.6.0 or just confirm my assumption.
It is possible to update to newer releases of Akka Persistence Cassandra in current versions of Lagom, by overriding a few configuration settings (the same ones that are applied to reference.conf and reference-overrides.conf in https://github.com/lagom/lagom/pull/1512).
That said, the update to version 4.x of the driver has not yet been done in Akka Persistence Cassandra, and Lightbend has not done any testing so far of either Lagom or Akka Persistence Cassandra with Cassandra 4.0 pre-releases. I wouldn’t expect it to work smoothly at this point. We would be happy to work with community members who want to try Cassandra 4.0. @ja2c86, if you are interested in sending pull requests for 4.0 compatibility, we would welcome and appreciate that (assuming they remain backward compatible with Cassandra 3.x).
If you need some pointers, I think the first step would be to work out which table is triggering the error. If it isn’t indicated in the logs, perhaps you could do try manually running the schema creation statements one at a time to see which one is causing the problem.