Explicit sync continues from last fully-processed ad #2328
Merged
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.
Context
An explicit (manual) sync will do nothing if all the advertisements have been synced, but their entries have not yet been synced. This means that either a new advertisement or an explicit resync is required to process the partially synced advertisements.
A common reason for doing a manual sync is to restart a sync that failed or was interrupted due to some error. A new advertisement may not be available to restart processing the advertisement chain, and ipnisync will not send a new advertisement notification because it has already seen the latest advertisement.
Auto-sync suffers from the same problem. If a sync is interrupted after the advertisement chain is synced, but before all the entries are synced, then subsequent polls will do nothing until a new advertisement is published.
This allows polling to resume a sync that failed due to #2318 when no new advertisements have been published.
Proposed Changes
Before performing an explicit sync (not resync) or an auto-sync from polling, set the subscriber's last known sync to the last fully processed sync known to the ingester.
Tests
manual
Revert Strategy
Change is safe to revert.