Rollback deletes only tagged events (of tag_view) after the given sequence number #203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #202
The new rollback deletes only tagged events after the given sequence number. Since the new rollback doesn't execute the full rebuild of
tag_views
, which requires all old events, it can support the deletion of old events.Related components of Akka Persistence Cassandra
The related classes are the following:
CassandraJournal
: https://github.com/akka/akka-persistence-cassandra/blob/v1.0.5/core/src/main/scala/akka/persistence/cassandra/journal/CassandraJournal.scalaTagWriters
: https://github.com/akka/akka-persistence-cassandra/blob/v1.0.5/core/src/main/scala/akka/persistence/cassandra/journal/TagWriters.scalaTagWriter
: https://github.com/akka/akka-persistence-cassandra/blob/v1.0.5/core/src/main/scala/akka/persistence/cassandra/journal/TagWriter.scalaCassandraTagRecovery
: https://github.com/akka/akka-persistence-cassandra/blob/v1.0.5/core/src/main/scala/akka/persistence/cassandra/journal/CassandraTagRecovery.scalaThere are two tables (
tag_write_progress
,tag_scanning
) that track metadata fortag_views
table.tag_write_progress
tracks the last tagged events information that a tag writer successfully wrote intotag_view
.tag_write_progress
tracks the progress per the combination of persistence ID and tag.tag_scanning
tracks the first event info that the actor should scan at its start, which is not used for an event replay but used for a tag recovery. The tag recovery scans events and then writes events (if the event has a tag) totag_views
via a tag writer. The tag recovery is needed if tagged event writing is behind the event replay.