lerna-stack / akka-entity-replication

Akka extension for fast recovery from failure with replicating stateful entity on multiple nodes in Cluster
Apache License 2.0
30 stars 1 forks source link

`CassandraPersistenceQueries.currentEventsBefore` can skip deleted partitions #208

Closed xirc closed 1 year ago

xirc commented 1 year ago

For #201

CassandraPersistenceQueries.currentEventsBefore iterates events on all partitions (from + 1 to 0) but can skip deleted partitions by using the highest deleted sequence number (callled deleted_to), which reduces some read-events queries.

CassandraPersistenceQueries.currentEventsBefore: https://github.com/lerna-stack/akka-entity-replication/blob/1afe7992952c33b708809559b02eacf44f96dd77/rollback-tool-cassandra/src/main/scala/lerna/akka/entityreplication/rollback/cassandra/CassandraPersistenceQueries.scala#L177-L189

CassandraPersistenceQueries can fetch the highest deleted sequence number (called deleted_to) from the metadata table (akka.metadata).

deleted_to is described as: