Skip to content

Rollback deletes only tagged events (of tag_view) after the given sequence number #203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 27, 2023

Conversation

xirc
Copy link
Contributor

@xirc xirc commented Apr 13, 2023

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:

There are two tables (tag_write_progress, tag_scanning) that track metadata for tag_views table.

tag_write_progress tracks the last tagged events information that a tag writer successfully wrote into tag_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) to tag_views via a tag writer. The tag recovery is needed if tagged event writing is behind the event replay.

Taichi Yamakawa added 4 commits April 13, 2023 11:15
Since the rollback doesn't execute the tag view full rebuild, which
requires all past events, it can support the deletion of past events.
@xirc xirc marked this pull request as ready for review April 13, 2023 05:54
@xirc xirc requested a review from negokaz April 13, 2023 05:54
Copy link
Contributor

@negokaz negokaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! LGTM 👍

@negokaz negokaz merged commit cfdf813 into master Apr 27, 2023
@negokaz negokaz deleted the rollback-deletes-only-target-tagged-events branch April 27, 2023 10:43
@xirc xirc added this to the v2.3.0 milestone May 9, 2023
@xirc xirc added enhancement New feature or request and removed enhancement New feature or request labels May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoiding deletion of all tagged events in rollback
2 participants