Open alechenninger opened 8 years ago
The heart of this issue is that we want the notification processing to be transactional.
We are almost there, but can do some more. Brainstorming:
If 2 fails, stop and start over at 1. If 3 fails, try to rollback via set notifications to unprocessed and delete any pending document events. Then stop and start over at 1. If 4 fails, we could retry. It's either processing or processed, both are recoverable. Stop and start over at 1, unless retry is successful. Do not try to rollback notifications and doc events unless you know they are not marked processed, otherwise you could lose doc events. If 5 fails, we could retry, but that's it. Stop and start over at 1.
For document events, we should retrieve unprocessed (done), old processing (done), as well as expired pending (not done). Expired pending first check if their notifications are processed, and if so these can be processed as well. Otherwise, they can be deleted. We could consider checking if notifications are still processing within some timestamp threshold before deleting. Note that this will probably couple the document event store to the notification store.
Scenario:
That being said, they should mostly be superseded / merged away