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 C7BC29577 for ; Sat, 26 Nov 2011 17:46:01 +0000 (UTC) Received: (qmail 7727 invoked by uid 500); 26 Nov 2011 17:46:01 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 7692 invoked by uid 500); 26 Nov 2011 17:46:01 -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 7683 invoked by uid 99); 26 Nov 2011 17:46:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Nov 2011 17:46:01 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Nov 2011 17:46:00 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 0D4C5A1F63 for ; Sat, 26 Nov 2011 17:45:40 +0000 (UTC) Date: Sat, 26 Nov 2011 17:45:40 +0000 (UTC) From: "Filipe Manana (Updated) (JIRA)" To: dev@couchdb.apache.org Message-ID: <112489509.13842.1322329540055.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (COUCHDB-188) _bulk_docs fails when deleting and adding a doc with the same id MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Filipe Manana updated COUCHDB-188: ---------------------------------- Attachment: 0001-Allow-doc-delete-and-creation-in-the-same-bulk-updat.patch > _bulk_docs fails when deleting and adding a doc with the same id > ---------------------------------------------------------------- > > Key: COUCHDB-188 > URL: https://issues.apache.org/jira/browse/COUCHDB-188 > Project: CouchDB > Issue Type: Bug > Components: Database Core > Affects Versions: 0.9 > Environment: CouchDB revision 730414. > Reporter: Matt Goodall > Assignee: Filipe Manana > Priority: Blocker > Fix For: 1.2 > > Attachments: 0001-Allow-doc-delete-and-creation-in-the-same-bulk-updat.patch > > > CouchDB returns a "412 Precondition Failed" when the list of changes sent to _bulk_docs deletes a document and later creates a document with the same id as the deleted document: > {"docs": [ > {"_id": "docid", "_rev": "", "_deleted": true}, > {"_id": "docid"} > ]} > Once fixed, the response JSON document will return the same docid twice in the list but it's presumably ordered consistently with the request data so any client should be able to understand the response. > Demonstrating the problem using curl is easy enough: > $ curl -X PUT http://localhost:5984/test > {"ok":true} > $ curl -X PUT -d "{}" http://localhost:5984/test/docid > {"ok":true,"id":"docid","rev":"4140747751"} > $ curl -X POST -d '{"docs": [{"_id": "docid", "_rev": "4140747751", "_deleted": true}, {"_id": "docid"}]}' http://localhost:5984/test/_bulk_docs > {"error":"conflict","reason":"Document update conflict."} > Note: this is likely related to COUCHDB-172. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira