Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 15307DB17 for ; Sat, 23 Jun 2012 13:08:23 +0000 (UTC) Received: (qmail 13175 invoked by uid 500); 23 Jun 2012 13:08:21 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 13142 invoked by uid 500); 23 Jun 2012 13:08:21 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 13114 invoked by uid 99); 23 Jun 2012 13:08:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Jun 2012 13:08:20 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [87.117.198.154] (HELO zoe.mltserver-three.co.uk) (87.117.198.154) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Jun 2012 13:08:12 +0000 Received: from 02dc6bd1.bb.sky.com ([2.220.107.209]:63855 helo=[192.168.0.4]) by zoe.mltserver-three.co.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77) (envelope-from ) id 1SiQ47-0006gG-Cv for user@couchdb.apache.org; Sat, 23 Jun 2012 14:07:51 +0100 Date: Sat, 23 Jun 2012 14:07:51 +0100 From: Martin Hewitt To: user@couchdb.apache.org Message-ID: In-Reply-To: References: <4816C934ECDA4C89B5B61A4E3A4E4B57@thenoi.se> Subject: Re: _replicator endpoint and idempotency X-Mailer: sparrow 1.6.1 (build 1081.51) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="4fe5bfa7_238e1f29_b00a" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - zoe.mltserver-three.co.uk X-AntiAbuse: Original Domain - couchdb.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - thenoi.se --4fe5bfa7_238e1f29_b00a Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks Dave, that was my interpretation of the docs as well, but I didn't see the exact phrasing I was looking for so thought it was worth checking out! Martin On Friday, 22 June 2012 at 11:53, Dave Cottlehuber wrote: > On 22 June 2012 04:03, Martin Hewitt 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 > > --4fe5bfa7_238e1f29_b00a--