Repository navigation
fix(npmjs): new versions silently missed due to non-monotonic changes feed - #1935
Merged
cdklabs-automation merged 1 commit intoSep 23, 2026
Merged
Conversation
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
cdklabs-automation
enabled auto-merge
September 22, 2026 13:37
mrgrain
force-pushed
the
mrgrain/fix/npmjs/windowed-scan-follower
branch
from
September 22, 2026 14:45
2cc1e91 to
7732d6c
Compare
… feed The npm replica's `_changes` feed occasionally makes change entries visible behind positions the follower has already read past, and the registry occasionally serves packuments older than the revision the feed announced. Both paths silently dropped package versions until the affected package published again. The follower no longer tracks a single high-water mark. It keeps a receipt for every change entry it has received, and every run re-scans a trailing window of the feed (newest slice first), processing any entry it has no receipt for. A periodic deep scan covers the full state retention so insertion delays beyond the regular window are still observed. When the registry serves a packument behind the announced revision (a laggy packument), the served versions are processed immediately and the announced revision is re-checked every run until it appears or the expectation ages out. State (receipts, checkpoints, laggy packuments) lives in a single scannable, newline-delimited S3 object. Existing deployments are migrated by seeding the first checkpoint from the legacy transaction marker. New LateChangeCount/LateChangeLag and LaggyPackuments metrics feed a Feed Reliability dashboard widget and two low-severity alarms. Internal reference: V2376798198
mrgrain
force-pushed
the
mrgrain/fix/npmjs/windowed-scan-follower
branch
from
September 22, 2026 14:55
f5eb8c1 to
0ab00ff
Compare
9pace
self-requested a review
September 22, 2026 17:45
rix0rrr
approved these changes
Sep 23, 2026
cdklabs-automation
deleted the
mrgrain/fix/npmjs/windowed-scan-follower
branch
September 23, 2026 08:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The npm replica's
_changesfeed occasionally makes change entries visible behind positions the follower has already read past (npm calls this normal feed behavior), and the registry occasionally serves packuments older than the revision the feed announced. Both cases silently dropped package versions until the affected package published again. In a recent incident, five consecutiveconstruct-hub-probeversions were missed over about 15 hours.The follower therefore no longer tracks a single high-water mark:
Observability:
LateChangeCountandLateChangeLagmeasure the feed's late insertions (the lag data is what tunes the scan window), andLaggyPackuments/LaggyPackumentsRecovered/LaggyPackumentGiveUpstrack the registry lagging the feed. They feed a new Feed Reliability dashboard widget and two low-severity alarms, both with runbook entries. The PR also addsdocs/npm-sync-protocol.md, documenting with citations what the feed does and does not guarantee, and updates the backfill instructions in the application overview for the new state model.Replaces #1933.
Internal reference: V2376798198
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license