-
Notifications
You must be signed in to change notification settings - Fork 138
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
Issue #775 - handle sequences deduplicated by server feed #798
Conversation
doc.RecentSequences = make([]uint64, 0, 1+len(unusedSequences)) | ||
} | ||
|
||
if len(doc.RecentSequences) > 20 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you refactor 20 into a named constant? (DedupWindowSize?)
…s on the buffered feed as appropriate. Works in standalone testing - still needs unit tests.
@@ -27,6 +27,7 @@ type syncData struct { | |||
Flags uint8 `json:"flags,omitempty"` | |||
Sequence uint64 `json:"sequence"` | |||
UnusedSequences []uint64 `json:"unused_sequences,omitempty"` | |||
RecentSequences []uint64 `json:"recent_sequences,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add docs for this field? I realize it won't "match" the other undocumented fields, but I think the ugliness is worth it from the perspective of someone trying to understand this struct. Actually these docs that were elsewhere in the code look perfect:
The server TAP/DCP feed will deduplicate multiple revisions for the same doc if they occur in the same mutation queue processing window. This results in missing sequences on the change listener. To account for this, we track the recent sequence numbers for the document.
7458496
to
314388d
Compare
0e5f68d
to
a8165f6
Compare
Issue #775 - handle sequences deduplicated by server feed
Write recent sequences to _sync metadata, to handle the case where the TAP or DCP feed deduplicates rapid multiple updates to the same doc.