Cassandra Snapshot Partition Key Change but seeing InvalidQueryException

(Rohit Mohta) #1

Hello,

For our application, we have changed partition key for snapshots table as mentioned below. Modified required statements and code for snapshot store to use appropriate query.

persistence_id
to
persistence_id, sequence_nr

Now when I try to recover them (as part of application restart) we see ReplayMessagesFailure with below error. Do I have to modify any other class that tries to query snapshots table?

java.util.concurrent.ExecutionException: com.datastax.driver.core.exceptions.InvalidQueryException: Cannot execute this query as it might involve data filtering and thus may have unpredictable performance. If you want to execute this query despite the performance unpredictability, use ALLOW FILTERING
	at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503) ~[guava-22.0.jar:?]
	at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:462) ~[guava-22.0.jar:?]
	at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79) ~[guava-22.0.jar:?]
(Patrik Nordwall) #2

What was the reason for changing the partition key?

The query for recovery is typically looking for the N oldest snapshots, and by changing the partition key those queries will span more than one partition, and the exact sequence number isn’t known.