Return-Path: Delivered-To: apmail-incubator-couchdb-dev-archive@locus.apache.org Received: (qmail 54944 invoked from network); 4 Dec 2008 00:56:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Dec 2008 00:56:59 -0000 Received: (qmail 34319 invoked by uid 500); 4 Dec 2008 00:57:10 -0000 Delivered-To: apmail-incubator-couchdb-dev-archive@incubator.apache.org Received: (qmail 34269 invoked by uid 500); 4 Dec 2008 00:57:10 -0000 Mailing-List: contact couchdb-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-dev@incubator.apache.org Delivered-To: mailing list couchdb-dev@incubator.apache.org Received: (qmail 34234 invoked by uid 99); 4 Dec 2008 00:57:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Dec 2008 16:57:10 -0800 X-ASF-Spam-Status: No, hits=2.4 required=10.0 tests=NORMAL_HTTP_TO_IP,SPF_PASS,URIBL_RHS_DOB,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jchris@gmail.com designates 74.125.44.158 as permitted sender) Received: from [74.125.44.158] (HELO yx-out-1718.google.com) (74.125.44.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 00:55:39 +0000 Received: by yx-out-1718.google.com with SMTP id 36so1750743yxh.0 for ; Wed, 03 Dec 2008 16:56:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=T5DaAbJdhG6UM5ASlSRsxE5FQdR8TR67j5QwzkpeWBs=; b=D47rkNr0dUd7/V2xbI/ELs5LY1dz7qfqVtSQdO3UR2qbIoxH9ZqN4+jaNcs5RjAN8I NzXK4b8Wg/nrVFefuqf0oeg6yMBL/F2UDAfyLBw51TBs3O6UkoUuSKtZTKcMvL5IFGVu p0jvzG+8CR+4b/t0gOOpL5hG2GRO4Vn0kNjoo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=rjc/jJ8ap1M3oevyVmWZUig0Pk7XtZVb/TWa9jaIsFrfE6LD9Wy6pWeIr08+8ERl1R u/ze/1YV+myC4Gbsx7Ynit3pYhtf9el/is9EXKHyDgkjprjHUnSTEi3GXwGRe6fvQ9co PbkbL6Kgzx3gLNnzg1VAFgaFPKRtWFyOE75mY= Received: by 10.65.75.2 with SMTP id c2mr13591779qbl.12.1228352186136; Wed, 03 Dec 2008 16:56:26 -0800 (PST) Received: by 10.65.235.11 with HTTP; Wed, 3 Dec 2008 16:56:26 -0800 (PST) Message-ID: Date: Wed, 3 Dec 2008 16:56:26 -0800 From: "Chris Anderson" Sender: jchris@gmail.com To: couchdb-dev@incubator.apache.org Subject: Re: bulk update: deleting and updating In-Reply-To: <6A48F931-172B-47D9-8959-1AB645278EFB@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20081203163944.GW13753@ginosko.local> <6A48F931-172B-47D9-8959-1AB645278EFB@apache.org> X-Google-Sender-Auth: 6ce994383dbec367 X-Virus-Checked: Checked by ClamAV on apache.org I like Damien's solution. Michael, have you got the bandwidth to put together a couch_tests.js patch that shows the error? On Wed, Dec 3, 2008 at 8:48 AM, Damien Katz wrote: > It's not intended behavior, but I'd say just don't do that. Editing the same > document twice in a bulk update is not supported. Maybe we should add an > explicit check and return an error. > > -Damien > > On Dec 3, 2008, at 11:39 AM, Michael Hendricks wrote: > >> What should be the proper behavior for a bulk update request which >> asks to delete a document and to update it at the same time? For >> example: >> >> POST http://127.0.0.1:5984/net-couchdb-11942-61931/_bulk_docs >> Accept: application/json >> Content-Length: 104 >> >> >> {"docs":[{"_deleted":true,"_id":"drei","_rev":"683265243"},{"_id":"drei","third":3,"_rev":"683265243"}]} >> >> Until recently (r713132), CouchDB returned a 412 response to indicate >> that there was a conflict. That seems like the right thing to do. >> The new response seems broken: >> >> HTTP/1.1 201 Created >> Cache-Control: must-revalidate >> Date: Wed, 03 Dec 2008 16:24:15 GMT >> Server: CouchDB/0.9.0a-incubating (Erlang OTP/R12B) >> Content-Length: 89 >> Content-Type: application/json >> Client-Date: Wed, 03 Dec 2008 16:24:15 GMT >> Client-Peer: 127.0.0.1:5984 >> Client-Response-Num: 15 >> >> >> {"ok":true,"new_revs":[{"id":"drei","rev":"2472902046"},{"id":"drei","rev":"965136091"}]} >> >> In other words, it created two new revisions for the same document. >> Is that intended behavior? >> >> -- >> Michael > > -- Chris Anderson http://jchris.mfdz.com