Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit sync continues from last fully-processed ad #2328

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

gammazero
Copy link
Collaborator

@gammazero gammazero commented Oct 6, 2023

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.

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 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.
@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (db873b1) 46.71% compared to head (7a1c8f9) 46.78%.
Report is 1 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2328      +/-   ##
==========================================
+ Coverage   46.71%   46.78%   +0.07%     
==========================================
  Files          84       84              
  Lines        9961     9964       +3     
==========================================
+ Hits         4653     4662       +9     
+ Misses       4776     4771       -5     
+ Partials      532      531       -1     
Files Coverage Δ
internal/ingest/ingest.go 71.37% <100.00%> (+0.71%) ⬆️
server/admin/handler.go 13.12% <0.00%> (+0.02%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gammazero gammazero merged commit 9ef0868 into main Oct 6, 2023
9 checks passed
@gammazero gammazero deleted the manual-sync-from-last-ingested branch October 6, 2023 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants