Skip to content
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

Support deleting old events and snapshots #204

Merged
merged 20 commits into from
May 19, 2023

Conversation

xirc
Copy link
Contributor

@xirc xirc commented Apr 28, 2023

Closes: #201

akka-entity-replication supports deleting old events and snapshots. This deletion feature is an opt-in feature (disabled is the default) since it only supports the Akka Persistence Cassandra. The deletion criteria is based on sequence number.

There are four related persistent actors:

  • lerna.akka.entityreplication.raft.RaftActor
  • lerna.akka.entityreplication.raft.snapshot.sync.SnapshotSyncManager
  • lerna.akka.entityreplication.raft.snapshot.SnapshotStore
  • lerna.akka.entityreplication.raft.eventsourced.CommitLogStoreActor

They delete old events and snapshots automatically when they save a snapshot. If a deletion fails, they will log a warning message.

The newly introduced settings are:

  • lerna.akka.entityreplication.raft.delete-old-events
  • lerna.akka.entityreplication.raft.delete-old-snapshots
  • lerna.akka.entityreplication.raft.delete-before-relative-sequence-nr
  • lerna.akka.entityreplication.raft.snapshot-sync.delete-old-events
  • lerna.akka.entityreplication.raft.snapshot-sync.delete-old-snapshots
  • lerna.akka.entityreplication.raft.snapshot-sync.delete-before-relative-sequence-nr
  • lerna.akka.entityreplication.raft.entity-snapshot-store.delete-old-events
  • lerna.akka.entityreplication.raft.entity-snapshot-store.delete-old-snapshots
  • lerna.akka.entityreplication.raft.entity-snapshot-store.delete-before-relative-sequence-nr
  • lerna.akka.entityreplication.raft.eventsourced.persistence.delete-old-events
  • lerna.akka.entityreplication.raft.eventsourced.persistence.delete-old-snapshots
  • lerna.akka.entityreplication.raft.eventsourced.persistence.delete-before-relative-sequence-nr

@xirc xirc marked this pull request as ready for review May 9, 2023 00:08
@xirc xirc requested a review from negokaz May 9, 2023 00:09
@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
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.

Great! I left some comments.

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 5b8fe7b into master May 19, 2023
@negokaz negokaz deleted the support-deleting-old-events-and-snapshots branch May 19, 2023 06:32
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.

Support deletion of old events and snapshots
2 participants