Re: sg-replicate creating new local document for every restart

35 views
Skip to first unread message

Jens Alfke

unread,
Sep 13, 2016, 2:49:57 PM9/13/16
to Couchbase Mobile

> On Sep 13, 2016, at 7:28 AM, arihant rk <ark...@gmail.com> wrote:
>
> i have configured sg-replicate configuration in syncgateway configuration and also provided replication id. but could able to see that _sync:local documents.

The replication algorithm creates these documents in the remote database to store ‘checkpoint’ data. This helps to guard against inconsistencies if the remote (or local) database regresses due to a restore from a backup. Mobile clients create these too.

Just ignore them. They’re an internal detail of Sync Gateway and the replicator, just like everything else in the bucket that starts with “_sync:”.

—Jens

arihant rk

unread,
Sep 14, 2016, 1:45:34 AM9/14/16
to Couchbase Mobile
Thanks jens for quick reply, just a thought, cant sg-replicate update same local document instead of creating new document with reference to replication id. in worst case if sg-replicate restarts several times, there will be several local documents which are obsolete and these will not be purged in future. 

Jens Alfke

unread,
Sep 14, 2016, 12:49:36 PM9/14/16
to mobile-c...@googlegroups.com

On Sep 13, 2016, at 10:45 PM, arihant rk <ark...@gmail.com> wrote:

Thanks jens for quick reply, just a thought, cant sg-replicate update same local document instead of creating new document with reference to replication id.

It should use the same local document on every replication, assuming the replication parameters are the same (direction, continuous, filters, etc.). If it’s creating a new document every time it replicates, that would be a bug.

—Jens

Traun Leyden

unread,
Sep 14, 2016, 12:54:26 PM9/14/16
to mobile-c...@googlegroups.com

Jens,

That might be an issue, thanks for pointing that out.

I filed a ticket to look into that -- https://github.com/couchbaselabs/sg-replicate/issues/41

--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchbase+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/F3AB8A09-B01A-47BB-8B37-696ED23F8A43%40couchbase.com.

For more options, visit https://groups.google.com/d/optout.

arihant rk

unread,
Sep 15, 2016, 1:14:51 AM9/15/16
to Couchbase Mobile
Thanks Jens for info, i was not providing replicate_id explicitly in config file which is causing change of configuration body each time, hence new local documents were creating. i have provided the replicate_id and now its working as expected.

Thanks Traun, looks like no issue when we have no change config file.

am curious to know what is _rev field in local document, like "_rev": "0-2",


On Wednesday, September 14, 2016 at 10:24:26 PM UTC+5:30, Traun Leyden wrote:

Jens,

That might be an issue, thanks for pointing that out.

I filed a ticket to look into that -- https://github.com/couchbaselabs/sg-replicate/issues/41
On Wed, Sep 14, 2016 at 9:49 AM, Jens Alfke <je...@couchbase.com> wrote:

On Sep 13, 2016, at 10:45 PM, arihant rk <ark...@gmail.com> wrote:

Thanks jens for quick reply, just a thought, cant sg-replicate update same local document instead of creating new document with reference to replication id.

It should use the same local document on every replication, assuming the replication parameters are the same (direction, continuous, filters, etc.). If it’s creating a new document every time it replicates, that would be a bug.

—Jens

--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages