Process a mismatching of remote and local checkpoint

11 views
Skip to first unread message

Rustam Yuzmukhametov

unread,
May 8, 2015, 9:16:35 AM5/8/15
to mobile-c...@googlegroups.com
Hi,

In CBL_Replicator.m file I stumbled on the next code:

if ($equal(remoteLastSequence, localLastSequence)) {
  _lastSequence
= localLastSequence;
 
if (!_lastSequence) {
     
// Try to get the last sequence from the local checkpoint document
     
// created only when importing a database. This allows the
     
// replicator to continue replicating from the current local checkpoint
     
// of the imported database after importing.
      _lastSequence
= [self getLastSequenceFromLocalCheckpointDocument];
 
}
 
LogTo(Sync, @"%@: Replicating from lastSequence=%@", self, _lastSequence);
} else {
 
LogTo(Sync, @"%@: lastSequence mismatch: I had %@, remote had %@ (response = %@)",
       
self, localLastSequence, remoteLastSequence, response);
}


As I understand when we get different checkpoints we start replication from start.
What if we take a minimum from local and remote sequence and start a replication from this value?

Thank you!

Jens Alfke

unread,
May 8, 2015, 11:58:10 AM5/8/15
to mobile-c...@googlegroups.com

On May 8, 2015, at 6:16 AM, Rustam Yuzmukhametov <ryuzmuk...@gmail.com> wrote:

What if we take a minimum from local and remote sequence and start a replication from this value?

Unfortunately remote sequences are opaque IDs and can’t be treated as ordered. (Most of the time the ones you see from Sync Gateway are numbers, but they aren’t always, and some other servers like BigCouch send long base64’d blobs.)

—Jens
Reply all
Reply to author
Forward
0 new messages