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 47ECA11FDF for ; Fri, 27 Jun 2014 14:25:26 +0000 (UTC) Received: (qmail 96571 invoked by uid 500); 27 Jun 2014 14:25:26 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 96513 invoked by uid 500); 27 Jun 2014 14:25:25 -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 96499 invoked by uid 99); 27 Jun 2014 14:25:25 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jun 2014 14:25:25 +0000 Date: Fri, 27 Jun 2014 14:25:25 +0000 (UTC) From: "Joan Touzet (JIRA)" To: dev@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (COUCHDB-1415) Re-insering a document silently fails after compact is executed 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-1415?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joan Touzet updated COUCHDB-1415: --------------------------------- Fix Version/s: 2.0.0 > Re-insering a document silently fails after compact is executed > --------------------------------------------------------------- > > Key: COUCHDB-1415 > URL: https://issues.apache.org/jira/browse/COUCHDB-1415 > Project: CouchDB > Issue Type: Bug > Components: Database Core > Affects Versions: 1.1.1 > Environment: Tested on multiple linux platforms > Reporter: Viktor Szabo > Assignee: Paul Joseph Davis > Fix For: 2.0.0 > > Attachments: patch > > > When a document is re-inserted after a compact operation using the same contents it was originally created, the insert operation is silently ignored, leaving the client unaware of the fact it's document is not available in the database. > Can be reproduced using the following sequence of steps: > alias curl='curl -H "Content-Type: application/json"' > url="http://localhost:5984/database" > 1 curl -X PUT $url > 2 curl -X POST $url -d '{"_id": "bug", "key": "value"}' > 3 curl -X DELETE "$url/bug?rev=1-59414e77c768bc202142ac82c2f129de" > 4 curl -X POST "$url/_compact" > 5 curl -X POST $url -d '{"_id": "bug", "key": "value"}' > 6 curl -X GET "$url/bug" > (bug here) > 1 {"ok":true} > 201 > 2 [{"ok":true,"id":"bug","rev":"1-59414e77c768bc202142ac82c2f129de"}] > 201 > 3 {"ok":true,"id":"bug","rev":"2-9b2e3bcc3752a3a952a3570b2ed4d27e"} > 200 > 4 {"ok":true} > 202 > 5 [{"ok":true,"id":"bug","rev":"1-59414e77c768bc202142ac82c2f129de"}] > 201 > 6 {"error":"not_found","reason":"deleted"} > 404 > CouchDB shouldn't report "ok" on step 5 and then go on to claim that the doc is deleted. Also, it seems to work on second try: > 7 curl -X POST $url -d '{"_id": "bug", "key": "value"}' > 8 curl -X GET "$url/bug" > 7 {"ok":true,"id":"bug","rev":"3-674f864b73df1c80925e48436e21d550"} > 201 > 8 {"_id":"bug","_rev":"3-674f864b73df1c80925e48436e21d550","key":"value"} > 200 -- This message was sent by Atlassian JIRA (v6.2#6252)