Rollback preparation fails if required data have been deleted #210
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 #206
Once data (events or snapshots) have been deleted, a rollback to a timestamp that requires such deleted data is impossible. This PR changes the rollback preparation (
prepareRollback
) such that it fails if required data have already been deleted.The rollback preparation checks that each persistent actor can be rolled back (the persistent actor has a consistent state after rollback) based on sequence numbers. These checks involve the following component:
RollbackRequirementsVerifier
: for each persistent actor, it verifies whether the rollback is possible.PersistentActorRollback.findRollbackRequirements
: for each persistent actor, it finds the possible lowest sequence number such that the persistent actor is consistent after rollbacks.RollbackTimestampHintFinder
: it finds a timestamp hint if the rollback is impossible. Rollbacks should specify a newer timestamp than the hint, at least. While the hint might need to be more strictly correct, it helps to know why the given timestamp-based rollback is impossible.