CassandraPersistenceQueries
should find the highest sequence number even if deleted partition exists
#207
Milestone
CassandraPersistenceQueries
should find the highest sequence number even if deleted partition exists
#207
For #201
CassandraPersistenceQueries
doesn't yet support deleted partitions (which are empty).CassandraPersistenceQueries
can handle one empty partition but not two or more consecutive empty partitions:akka-entity-replication/rollback-tool-cassandra/src/main/scala/lerna/akka/entityreplication/rollback/cassandra/CassandraPersistenceQueries.scala
Lines 59 to 93 in 1afe799
For example,
CassandraPersistenceQueries.findHighestSequenceNr
returns aFuture
containingNone
mistakenly in some cases if two or more consecutive empty partitions exist (all events on those partitions have been deleted).Suppose that:
CassandraPersistenceQueries.findHighestSequenceNr(persistenceId=???,from=PartitionNr(0))
returns aFuture
containingNone
now but should return the highest sequence number 26 instead.Because
LinearSequenceNrSearchStrategy
(https://github.com/lerna-stack/akka-entity-replication/blob/v2.2.0/rollback-tool-cassandra/src/main/scala/lerna/akka/entityreplication/rollback/LinearSequenceNrSearchStrategy.scala) depends onCassandraPersistenceQueries.findHighestSequenceNr
indirectly, a rollback might be impossible if two or more deleted partitions exist.To address this issue,
CassandraPersistenceQueries
can fetch the highest deleted sequence number (calleddeleted_to
) from the metadata table (akka.metadata
) and then skip deleted partitions.Akka Persistence Cassandra Journal Schema is described as:
The text was updated successfully, but these errors were encountered: