Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8B10894DA for ; Fri, 2 Mar 2012 13:11:34 +0000 (UTC) Received: (qmail 25211 invoked by uid 500); 2 Mar 2012 13:11:34 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 25162 invoked by uid 500); 2 Mar 2012 13:11:33 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 25154 invoked by uid 99); 2 Mar 2012 13:11:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2012 13:11:33 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of koeglstefan@gmail.com designates 209.85.210.180 as permitted sender) Received: from [209.85.210.180] (HELO mail-iy0-f180.google.com) (209.85.210.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2012 13:11:27 +0000 Received: by iage36 with SMTP id e36so3058522iag.11 for ; Fri, 02 Mar 2012 05:11:03 -0800 (PST) Received-SPF: pass (google.com: domain of koeglstefan@gmail.com designates 10.50.181.169 as permitted sender) client-ip=10.50.181.169; Authentication-Results: mr.google.com; spf=pass (google.com: domain of koeglstefan@gmail.com designates 10.50.181.169 as permitted sender) smtp.mail=koeglstefan@gmail.com; dkim=pass header.i=koeglstefan@gmail.com Received: from mr.google.com ([10.50.181.169]) by 10.50.181.169 with SMTP id dx9mr1608175igc.46.1330693863676 (num_hops = 1); Fri, 02 Mar 2012 05:11:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=hnnqy/grYncyvcLR/meN4LCFrPiJz1ag7gk19+Pd1sg=; b=x2R/HficypIm/6jPTuDD7FOlGWlVp0Cdlc1Uk3GTW6Yn6s2lD8DMAFv/FMCcZdlgC0 e0TUoRN6wLy+gxvIMeQEGvdeqR2nQ+DsGbyrjmo/1ILwR3TbyUO0nlAB87356NIQw+uG pcwpnjC/FE7Qzi7K/Oy130Jk3Z3CDQwaRQYbGjMZZrSSAHbaSr7cZzmjM4SxOxq1zW/w 2hDbmqE1OgjqAMT3VL3Tu3b8J7VJG2Dd9Q/narw0onFYDVIqDjCULzuDFUIMgMFNTfVG EXP4A1LdFZmi/tVyN1kDwD77gDcakJFLHDZfxaAHpQMELRZIEU9Bxd+K4cB7g2eqQm25 oHrA== MIME-Version: 1.0 Received: by 10.50.181.169 with SMTP id dx9mr1333169igc.46.1330693863451; Fri, 02 Mar 2012 05:11:03 -0800 (PST) Received: by 10.42.174.3 with HTTP; Fri, 2 Mar 2012 05:11:03 -0800 (PST) In-Reply-To: <86FAED34-1BA3-4641-ACFB-FEEAC063C412@apache.org> References: <86FAED34-1BA3-4641-ACFB-FEEAC063C412@apache.org> Date: Fri, 2 Mar 2012 14:11:03 +0100 Message-ID: Subject: Re: Update Conflict for PUT/DELETE in _replicator From: =?ISO-8859-1?Q?Stefan_K=F6gl?= To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Mar 2, 2012 at 1:39 PM, Jan Lehnardt wrote: > On Mar 2, 2012, at 13:25 , Stefan K=F6gl wrote: >> Again something I noticed during my 1.2.x experiments: It seems I >> can't update or remove a document from the _replicator database, which >> I use for pull-replication into my 1.2.x instance. >> >> # get current _rev >> $ curl http://127.0.0.1:5984/_replicator/mygpo >> {"_id":"mygpo","_rev":"131-57b4da8d3163468cb0bbf4fd30c87832","source":"*= ***********************","target":"http://127.0.0.1:5984/mygpo","create_tar= get":false,"continuous":true,"user_ctx":{"name":"stefan","roles":["admin"]}= ,"owner":"stefan","_replication_state":"triggered","_replication_state_time= ":"2012-03-02T02:56:12+00:00","_replication_id":"f9fc5457b278d3cdb1ba2f1881= 253b04"} >> >> # try to delete >> $ curl -X DELETE >> "http://127.0.0.1:5984/_replicator/mygpo?_rev=3D131-57b4da8d3163468cb0bb= f4fd30c87832" >> {"error":"conflict","reason":"Document update conflict."} > > this should be ?rev=3D... (no underscore) Of course, I also tried that but it didn't work either... see below. >> $ curl -X PUT "http://127.0.0.1:5984/_replicator/mygpo" -d @replication.= json > > Can you try adding the ?rev=3D in the URL as well? # get the rev first $ curl http://127.0.0.1:5984/_replicator/mygpo {"_id":"mygpo","_rev":"131-57b4da8d3163468cb0bbf4fd30c87832","source":"****= ****************","target":"http://127.0.0.1:5984/mygpo","create_target":fa= lse,"continuous":true,"user_ctx":{"name":"stefan","roles":["admin"]},"owner= ":"stefan","_replication_state":"triggered","_replication_state_time":"2012= -03-02T02:56:12+00:00","_replication_id":"f9fc5457b278d3cdb1ba2f1881253b04"= } # delete with rev instead of _rev $ curl -X DELETE "http://127.0.0.1:5984/_replicator/mygpo?rev=3D131-57b4da8d3163468cb0bbf4fd= 30c87832" {"error":"conflict","reason":"Document update conflict."} # now PUT with rev in URL $ curl -X PUT "http://127.0.0.1:5984/_replicator/mygpo?rev=3D131-57b4da8d31= 63468cb0bbf4fd30c87832" -d @replication.json {"error":"conflict","reason":"Document update conflict."} # still the same rev (no other change in between) $ curl http://127.0.0.1:5984/_replicator/mygpo {"_id":"mygpo","_rev":"131-57b4da8d3163468cb0bbf4fd30c87832","source":"****= ****************","target":"http://127.0.0.1:5984/mygpo","create_target":fa= lse,"continuous":true,"user_ctx":{"name":"stefan","roles":["admin"]},"owner= ":"stefan","_replication_state":"triggered","_replication_state_time":"2012= -03-02T02:56:12+00:00","_replication_id":"f9fc5457b278d3cdb1ba2f1881253b04"= } -- Stefan