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

Issue #775 - handle sequences deduplicated by server feed #798

Merged
merged 4 commits into from
Apr 27, 2015

Conversation

adamcfraser
Copy link
Collaborator

Write recent sequences to _sync metadata, to handle the case where the TAP or DCP feed deduplicates rapid multiple updates to the same doc.

doc.RecentSequences = make([]uint64, 0, 1+len(unusedSequences))
}

if len(doc.RecentSequences) > 20 {
Copy link
Contributor

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"`
Copy link
Contributor

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.

@tleyden tleyden force-pushed the feature/issue_775 branch from 7458496 to 314388d Compare April 27, 2015 19:38
@tleyden tleyden force-pushed the feature/issue_775 branch from 0e5f68d to a8165f6 Compare April 27, 2015 23:04
tleyden added a commit that referenced this pull request Apr 27, 2015
Issue #775 - handle sequences deduplicated by server feed
@tleyden tleyden merged commit c359969 into master Apr 27, 2015
@tleyden tleyden removed the review label Apr 27, 2015
@tleyden tleyden deleted the feature/issue_775 branch April 27, 2015 23:07
tleyden pushed a commit that referenced this pull request Apr 28, 2015
The tap de-dupe will be useful for creating an enhanced unit test for Issue #775.  See #798
tleyden pushed a commit that referenced this pull request Apr 28, 2015
The tap de-dupe will be useful for creating an enhanced unit test for Issue #775.  See #798
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.

2 participants