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

Newly-pulled docs shouldn't show up in pusher's pendingDocuments #1332

Merged
merged 1 commit into from
Jul 1, 2016

Conversation

snej
Copy link
Contributor

@snej snej commented Jun 29, 2016

When the pusher is notified of a new revision, but decides to ignore it
because it's an 'echo' from a pull replication (or because it's rejected
by the filter), it should advance the checkpoint past that rev's
sequence.

This is a good optimization in general, to prevent the next push from
re-scanning the same revisions, but more importantly it tells
CBLReplication.pendingDocuments that those revisions aren't pending.

To fix this I did have to change the timing at which the pusher adds
revs to its internal _pendingSequences set, because it needs to happen
at the same time that skipped sequences are being handled.

Fixes #1274

When the pusher is notified of a new revision, but decides to ignore it
because it's an 'echo' from a pull replication (or because it's rejected
by the filter), it should advance the checkpoint past that rev's
sequence.

This is a good optimization in general, to prevent the next push from
re-scanning the same revisions, but more importantly it tells
CBLReplication.pendingDocuments that those revisions aren't pending.

To fix this I did have to change the timing at which the pusher adds
revs to its internal _pendingSequences set, because it needs to happen
at the same time that skipped sequences are being handled.

Fixes #1274
@snej snej added this to the 1.3 milestone Jun 29, 2016
@@ -606,23 +606,23 @@ - (void) test10_ReplicationCookie {
NSHTTPCookieOriginURL: remoteDbURL,
NSHTTPCookiePath: remoteDbURL.path,
NSHTTPCookieValue: @"logmein",
NSHTTPCookieExpires: [NSDate dateWithTimeIntervalSinceNow: 10]
NSHTTPCookieExpires: [NSDate distantFuture]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Not related to this fix, but I think this will prevent intermittent failures in this unit test. (I got one of those failures just now.)

@pasin pasin merged commit 44bbbde into dev Jul 1, 2016
@pasin pasin deleted the fix/pending_1274 branch July 1, 2016 23:17
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