incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <d...@muse.net.nz>
Subject Re: _replicator endpoint and idempotency
Date Fri, 22 Jun 2012 10:53:53 GMT
On 22 June 2012 04:03, Martin Hewitt <martin@thenoi.se> wrote:
> Hi all,
>
> Just a quick question - if I have a replication payload and I post the same payload twice
to the _replicator endpoint, will it create two replication jobs or is the _id field in the
_replicator db a hash of the document?
>
> I'm trying to ensure continuous master-master behaviour and I'm wondering if I need to
read and check against the contents of the _replicator db or if CouchDB can sort it out for
me!
>
> Thanks,
>
> Martin

It's idempotent. Try it and see - you can see the id returned on creation:

Run 1:
{"ok":true,"_local_id":"b53bf6d24f7baca426fc0ccbbc5a7a8a+continuous"}

run 2:
{"ok":true,"_local_id":"b53bf6d24f7baca426fc0ccbbc5a7a8a+continuous"}

Or look later on using GET $COUCH/_active_tasks:
{
        "checkpointed_source_seq": 20122,
        "continuous": true,
        "doc_id": null,
        "doc_write_failures": 0,
        "docs_read": 0,
        "docs_written": 0,
        "missing_revisions_found": 0,
        "pid": "<0.842.3>",
        "progress": 100,
        "replication_id": "b53bf6d24f7baca426fc0ccbbc5a7a8a+continuous",
        "revisions_checked": 0,
        "source": "e2",
        "source_seq": 20122,
        "started_on": 1340360725,
        "target": "e1",
        "type": "replication",
        "updated_on": 1340360935
 },

And similar info is in couch.log as well of course.

A+
Dave

Mime
View raw message