From user-return-7238-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Sat Oct 31 00:38:12 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 68284 invoked from network); 31 Oct 2009 00:38:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Oct 2009 00:38:12 -0000 Received: (qmail 28097 invoked by uid 500); 31 Oct 2009 00:38:11 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 28031 invoked by uid 500); 31 Oct 2009 00:38:11 -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 28021 invoked by uid 99); 31 Oct 2009 00:38:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Oct 2009 00:38:11 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of adam.kocoloski@gmail.com designates 74.125.92.25 as permitted sender) Received: from [74.125.92.25] (HELO qw-out-2122.google.com) (74.125.92.25) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Oct 2009 00:38:01 +0000 Received: by qw-out-2122.google.com with SMTP id 9so721355qwb.29 for ; Fri, 30 Oct 2009 17:37:40 -0700 (PDT) Received: by 10.224.108.204 with SMTP id g12mr1370162qap.270.1256949460884; Fri, 30 Oct 2009 17:37:40 -0700 (PDT) Received: from ?10.0.1.9? (c-71-232-49-44.hsd1.ma.comcast.net [71.232.49.44]) by mx.google.com with ESMTPS id 20sm2449843qyk.5.2009.10.30.17.37.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 30 Oct 2009 17:37:38 -0700 (PDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: What happens with a document, if a conflict is not resolved? From: Adam Kocoloski In-Reply-To: <20091030131533.GA15455@uk.tiscali.com> Date: Fri, 30 Oct 2009 20:37:36 -0400 Content-Transfer-Encoding: 7bit Message-Id: <01E98E17-B6AF-4F2F-9752-23CE46D51336@apache.org> References: <20091030083352.GA6860@uk.tiscali.com> <20091030131533.GA15455@uk.tiscali.com> To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1076) X-Virus-Checked: Checked by ClamAV on apache.org On Oct 30, 2009, at 9:15 AM, Brian Candler wrote: > On Fri, Oct 30, 2009 at 08:33:52AM +0000, Brian Candler wrote: >> Yes, I know patches are welcome. The reason I'm not contributing >> code for >> this right now is that I have higher priorities - I'm happy to keep >> my app >> 409-tied while I work on other things. > > On the other hand, I am happy to contribute some documentation. I just > wrote the following page, which turned out to be longer than expected: > http://wiki.apache.org/couchdb/Replication_and_conflicts > > Some interesting things came out while working this through. You can > see an > example Ruby script I wrote which replaces GET and PUT with multi-rev > equivalents. I don't know of any existing client library which does > this, > but once you're clear what is needed, it's quite straightforward. > > Then if you use this, your application can forget about all 409 > handling, > because you'll never see one. > > I think turning this into a native API would be good - even if it's > just > GET ?all=true and PUT ?revs=[rev1,rev2,rev3] > > Regards, > > Brian. I like where your head's at on this, Brian. I should mention that it *is* possible to retrieve all conflict revisions of a document with one request: GET /db/bob?open_revs=all The response format is a slightly awkward Array -- I believe the first revision is the winning one. [{"ok":{"_id":"bob","_rev":"1-3453545",...}},{"ok": {"_id":"bob","_rev":"1-23042"] I think I'd be in favor of making the default GET include all conflicts, but probably in the _conflicts field so as to minimize the changes to the current API. I'm not sure a multi-rev version of PUT is as urgent a need. Best, Adam