apply event sourcing to message subscriptions #6920
Closed
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.
Description
This applies event sourcing to message subscriptions.
This implementation largely reflects option 2 described in the ticket.
It does so by defining an interface for the transient state. With this interface in place the following dependencies are introduced:
Pending...SubscriptionChecker
now depends on the transient state interface (and no longer on mutable persistent state interfaceThe implementation of the transient state is based on a simple sorted set.
Furthermore
sentTime
fields are removed from persistent state altogether.Major Flaws
The transient state does not participate in transaction rollback. As such the transient state can get out of sync with persistent state. In such a scenario, a command could be resent ad infinitum, because it will never be removed from transient state.
Other Shortcomings
commandSentTime
is not always updated exactly when the command is sent, it is sometimes updated when the persistent state is changed (which is a good proxy, but not precise)Related issues
closes #6364
Definition of Done
Code changes:
backport stable/0.25
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation: