You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Zoé Bellot <zo...@cozycloud.cc> on 2013/12/12 09:16:04 UTC
Force the start sequence of a replication
Hello couchDB users,
I would like to replicate two databases with a one-shot replication with a
filter which takes documents with a field 'docType' equals to File or
Folder. Once, this replication done, I would like to do a continuous
replication between these two databases with a filter which takes documents
with a field 'docType' equals to File or Folder and deleted document.
However, I would like to start the second replication at the last sequence
of the first replication. I can find the sequence number in the first
replication information but I don't know how force the second replication
to start at this sequence.
Is there a way to do this ?
Thanks for your answer.
Sorry for my english, I'm not a native English speaker.
Zoé
Re: Force the start sequence of a replication
Posted by Zoé Bellot <zo...@cozycloud.cc>.
Thanks for your answer.
Zoé
2013/12/12 Robert Newson <rn...@apache.org>
> Hi,
>
> Add a property called "since_seq" to your second replication with the
> update sequence you wish to start at. Like;
>
> {"source":"source url here", "target":"target url", "since_seq":99999}
>
> This was introduce in CouchDB 1.2.0;
>
> * Added optional field `since_seq` to replication objects/documents.
> It allows to bootstrap a replication from a specific source sequence
> number.
>
> Also works at Cloudant.
>
> B.
>
> On 12 December 2013 08:16, Zoé Bellot <zo...@cozycloud.cc> wrote:
> > Hello couchDB users,
> >
> > I would like to replicate two databases with a one-shot replication with
> a
> > filter which takes documents with a field 'docType' equals to File or
> > Folder. Once, this replication done, I would like to do a continuous
> > replication between these two databases with a filter which takes
> documents
> > with a field 'docType' equals to File or Folder and deleted document.
> >
> > However, I would like to start the second replication at the last
> sequence
> > of the first replication. I can find the sequence number in the first
> > replication information but I don't know how force the second replication
> > to start at this sequence.
> > Is there a way to do this ?
> >
> > Thanks for your answer.
> >
> > Sorry for my english, I'm not a native English speaker.
> >
> > Zoé
>
Re: Force the start sequence of a replication
Posted by Robert Newson <rn...@apache.org>.
Hi,
Add a property called "since_seq" to your second replication with the
update sequence you wish to start at. Like;
{"source":"source url here", "target":"target url", "since_seq":99999}
This was introduce in CouchDB 1.2.0;
* Added optional field `since_seq` to replication objects/documents.
It allows to bootstrap a replication from a specific source sequence
number.
Also works at Cloudant.
B.
On 12 December 2013 08:16, Zoé Bellot <zo...@cozycloud.cc> wrote:
> Hello couchDB users,
>
> I would like to replicate two databases with a one-shot replication with a
> filter which takes documents with a field 'docType' equals to File or
> Folder. Once, this replication done, I would like to do a continuous
> replication between these two databases with a filter which takes documents
> with a field 'docType' equals to File or Folder and deleted document.
>
> However, I would like to start the second replication at the last sequence
> of the first replication. I can find the sequence number in the first
> replication information but I don't know how force the second replication
> to start at this sequence.
> Is there a way to do this ?
>
> Thanks for your answer.
>
> Sorry for my english, I'm not a native English speaker.
>
> Zoé
Re: Force the start sequence of a replication
Posted by Zoé Bellot <zo...@cozycloud.cc>.
Hi Dave,
It works for me.
Thanks.
Zoé
2013/12/12 Dave Cottlehuber <dc...@jsonified.com>
> Salut Zoé
>
> I'm pretty sure you can use `since_seq = <number> ` in your POST to the
> _replicator endpoint.
>
>
>
> https://github.com/apache/couchdb/blob/master/src/couch_replicator/src/couch_replicator.erl#L548
>
> This was added in mmm 1.2.x I think. If it works, please confirm back, I
> will update docs for it.
>
> A+
> Dave
>
>
>
> On 12 December 2013 09:16, Zoé Bellot <zo...@cozycloud.cc> wrote:
>
> > Hello couchDB users,
> >
> > I would like to replicate two databases with a one-shot replication with
> a
> > filter which takes documents with a field 'docType' equals to File or
> > Folder. Once, this replication done, I would like to do a continuous
> > replication between these two databases with a filter which takes
> documents
> > with a field 'docType' equals to File or Folder and deleted document.
> >
> > However, I would like to start the second replication at the last
> sequence
> > of the first replication. I can find the sequence number in the first
> > replication information but I don't know how force the second replication
> > to start at this sequence.
> > Is there a way to do this ?
> >
> > Thanks for your answer.
> >
> > Sorry for my english, I'm not a native English speaker.
> >
> > Zoé
> >
>
Re: Force the start sequence of a replication
Posted by Dave Cottlehuber <dc...@jsonified.com>.
Salut Zoé
I'm pretty sure you can use `since_seq = <number> ` in your POST to the
_replicator endpoint.
https://github.com/apache/couchdb/blob/master/src/couch_replicator/src/couch_replicator.erl#L548
This was added in mmm 1.2.x I think. If it works, please confirm back, I
will update docs for it.
A+
Dave
On 12 December 2013 09:16, Zoé Bellot <zo...@cozycloud.cc> wrote:
> Hello couchDB users,
>
> I would like to replicate two databases with a one-shot replication with a
> filter which takes documents with a field 'docType' equals to File or
> Folder. Once, this replication done, I would like to do a continuous
> replication between these two databases with a filter which takes documents
> with a field 'docType' equals to File or Folder and deleted document.
>
> However, I would like to start the second replication at the last sequence
> of the first replication. I can find the sequence number in the first
> replication information but I don't know how force the second replication
> to start at this sequence.
> Is there a way to do this ?
>
> Thanks for your answer.
>
> Sorry for my english, I'm not a native English speaker.
>
> Zoé
>