Alexander Kolbasov I finally got these decisions ideas on the HMSFollower that will require a full snapshot. One question first, should we allow forcing a snapshot while HMSFollower is running? or should this forcing state be saved on the Sentry store so we do a full snapshot on the next Sentry service restart?
How and when to detect a full snapshot is required?
During HMSFollower constructor:
- No transactions have been processed yet (current situation).
- Sentry store has a PARTIAL_SNAPSHOT state (Note: Any error while processing notifications should set PARTIAL_SNAPSHOT state on the Sentry store).
During HMSFollower start:
- Sentry latest notification ID > HMS latest notification ID.
- HMS latest notification ID - Sentry latest notification ID has a gap of notifications (due to HMS notification cleanup).
i.e. Sentry has id=40 and HMS has id=150. 150-40=110 notifications should be fetched from HMS, but only 90 are fetched.
This is a new decision as well:
- What if Sentry id 40 and HMS id 40 are different? Let's say HMS had a cleanup, and HMS did exactly 40 notifications after it. Sentry won't be in sync because even if it already processed 40 notifications before, the HMS has different metadata. This looks too unlikely, but should we take it into account?