Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


TDPusher needs to be more careful about updating lastSequence #246

snej opened this Issue · 0 comments

1 participant


I just looked through the TDPusher code and realized it's not as careful as TDPuller about advancing lastSequence (i.e. checkpointing.) It should advance lastSequence only if every revision in between has been successfully uploaded. But instead when a revision (or group) is uploaded, it advances lastSequence to that sequence, even though it might not be going strictly in order.

It should be using something like the TDSequenceMap that TDPuller uses. (It can probably get away with using just an NSIndexSet instead, since the sequence IDs it's dealing with are just integers.)

@snej snej was assigned
@snej snej referenced this issue in couchbaselabs/TouchDB-Android

Replication can miss documents #56

@snej snej closed this issue from a commit
@snej snej Make TDPusher more careful abut bumping the checkpoint
It now works similarly to the puller, using an NSIndexSet to keep track of which sequences haven't
yet been uploaded, and only advancing the checkpoint to just before the first sequence in the set.
This will fix possible edge cases/race conditions where the checkpoint may have been advanced too
optimistically, causing a doc that failed to be pushed once to never be retried. (Fixes #246)
@snej snej closed this in 9c9c730
@tleyden tleyden referenced this issue in couchbase/couchbase-lite-java-core

Pusher needs to be more careful about updating lastSequence #95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.