Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to diagnose non-replicating documents
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
lenkawell  
View profile  
 More options Nov 6 2012, 5:17 pm
From: lenkawell <len.kaw...@pepper.com>
Date: Tue, 6 Nov 2012 14:17:31 -0800 (PST)
Local: Tues, Nov 6 2012 5:17 pm
Subject: How to diagnose non-replicating documents

I have an iOS app with a TouchDB database that's replicated to Cloudant.
There are two documents of about 500 in a specific database on an iOS
device that have not been pushed up to Cloudant. That is, the two documents
are in the local database, but not in the Cloudant database (I've checked
with both Futon and another instance of my app). Other documents in the
database seem to be replicating back and forth OK.

Is there some way to diagnose why these documents have not replicated?

And is there a recommended way to "reset" replication on the device so it
tries to replicate those documents again? I currently have a button in the
UI that invokes the following method, but it doesn't seem to help in this
case:

// Restart any active syncing (i.e., any persistant replications).

- (void) restartSyncing {

    NSArray* repls = [currentDatabase replications];

    for (CouchPersistentReplication* repl in repls) {

        [repl restart];

    }

}

When I enable lots of TouchDB logging, I see a flurry of activity after
invoking this method, but no errors are logged, nor are do the document IDs
for the two documents show up in any of the log messages. I'm happy to send
along the log, if that'd be useful, though I'd like to learn how to
diagnose these problems.

I also tried using the app's Sign Out/Sign In buttons, which deletes the
CouchPersistentReplication objects and recreates them, but that didn't seem
to get the documents to replicate either.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jens Alfke  
View profile  
 More options Nov 6 2012, 6:03 pm
From: Jens Alfke <j...@mooseyard.com>
Date: Tue, 6 Nov 2012 15:03:47 -0800
Local: Tues, Nov 6 2012 6:03 pm
Subject: Re: How to diagnose non-replicating documents

On Nov 6, 2012, at 2:17 PM, lenkawell <len.kaw...@pepper.com> wrote:

> Is there some way to diagnose why these documents have not replicated?

At a high level there are two possibilities, corresponding to whether or not TouchDB ‘knows’ that it hasn’t replicated those documents. If it knows, it’ll keep trying to push them during every replication, and presumably get some sort of error. If it doesn’t know, then the replication checkpoint will have advanced past the last revisions of those documents, so it won’t even be trying.

Replicating with SyncVerbose logging should distinguish the two — look at the logs to see if it ever mentions the IDs of the problematic documents.

In either case there is likely a bug in TouchDB, but the type of bug depends on which kind of failure is occurring.

> And is there a recommended way to "reset" replication on the device so it tries to replicate those documents again?

There isn’t, although it would be a good idea to add a mechanism for it. The replication ‘checkpoint’ (the record of the last sequence to be synced) would need to be cleared. That lives in a _local document in both the source and destination database. You could delete that document if you knew its ID, but there’s no way to determine its ID (short of peeking at the localdocs table in the SQLite database.)

(I am not sure whether CouchDB has a mechanism to clear replication state, either.)

—Jens


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lenkawell  
View profile  
 More options Nov 13 2012, 9:54 pm
From: lenkawell <len.kaw...@pepper.com>
Date: Tue, 13 Nov 2012 18:54:41 -0800 (PST)
Local: Tues, Nov 13 2012 9:54 pm
Subject: Re: How to diagnose non-replicating documents

I've turned on SyncVerbose on a few devices and I do not see the missing
doc IDs in any of the log messages. If I modify the missing document on the
device that has it, the document will then replicate to Cloudant. Likewise,
new documents in either device replicate fine. But the fact that the
non-replicating documents didn't successfully replicate seems to be
forgotten by the replicator.

Is there anything else I can do to help these users get their databases
replicated completely? Any chance there's a way that I can cobble a
workaround together to hit the replication checkpoint with a big hammer
until there is an official "reset" API? I'm OK with it taking a long time
to replicate after the reset.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jens Alfke  
View profile  
 More options Nov 14 2012, 2:46 pm
From: Jens Alfke <j...@couchbase.com>
Date: Wed, 14 Nov 2012 11:46:49 -0800
Local: Wed, Nov 14 2012 2:46 pm
Subject: Re: How to diagnose non-replicating documents

On Nov 13, 2012, at 6:54 PM, lenkawell <len.kaw...@pepper.com<mailto:len.kaw...@pepper.com>> wrote:

Is there anything else I can do to help these users get their databases replicated completely? Any chance there's a way that I can cobble a workaround together to hit the replication checkpoint with a big hammer until there is an official "reset" API? I'm OK with it taking a long time to replicate after the reset.

I figured this would be trivial and started to tell you how to hack it, then realized it wasn’t :) so I added a real implementation. See my comments in #186<https://github.com/couchbaselabs/TouchDB-iOS/issues/186> for details on how to use it.

—Jens


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lenkawell  
View profile  
 More options Nov 14 2012, 9:53 pm
From: lenkawell <len.kaw...@pepper.com>
Date: Wed, 14 Nov 2012 18:53:08 -0800 (PST)
Local: Wed, Nov 14 2012 9:53 pm
Subject: Re: How to diagnose non-replicating documents

Thanks very much! I'll give it a try.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »