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 CC195CC68 for ; Thu, 5 Jul 2012 20:35:35 +0000 (UTC) Received: (qmail 81505 invoked by uid 500); 5 Jul 2012 20:35:35 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 81369 invoked by uid 500); 5 Jul 2012 20:35:35 -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 81272 invoked by uid 99); 5 Jul 2012 20:35:35 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2012 20:35:35 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 0774114285B for ; Thu, 5 Jul 2012 20:35:35 +0000 (UTC) Date: Thu, 5 Jul 2012 20:35:35 +0000 (UTC) From: "Joseph Heydorn (JIRA)" To: dev@couchdb.apache.org Message-ID: <816955456.10782.1341520535032.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1154153695.10680.1341519574457.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Updated] (COUCHDB-1509) Document creation fails after deleting and replicating 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-1509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joseph Heydorn updated COUCHDB-1509: ------------------------------------ Description: This is a bug which the team I work with found because we have a lot of unit tests which use CouchDB. To reproduce it, do the following: 1) Create a document in a database. 2) Delete that document. 3) Replicate that database to a second database. 4) Create that same document in the second database. Although CouchDB returns "ok":true, the document is not created (this is the bug). 5) Do step 4 again and the document is created. The following is my output from cmd.exe when I did the above steps using curl: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\jeheydor\Desktop>set couch=http://localhost:5984 C:\Users\jeheydor\Desktop>curl -X GET %couch% {"couchdb":"Welcome","version":"1.2.0"} C:\Users\jeheydor\Desktop>curl -X PUT %couch%/db {"ok":true} C:\Users\jeheydor\Desktop>curl -X PUT %couch%/db-replica {"ok":true} C:\Users\jeheydor\Desktop>curl -X POST %couch%/db -d "@test-doc.json" -H "Conten t-Type: application/json" {"ok":true,"id":"1","rev":"1-a422bdfbb43a534656f6c14b210ac65b"} C:\Users\jeheydor\Desktop>curl -X DELETE %couch%/db/1?rev="1-a422bdfbb43a534656f 6c14b210ac65b" {"ok":true,"id":"1","rev":"2-d015c0459177c2f893cc691f9144ca5e"} C:\Users\jeheydor\Desktop>curl -X POST %couch%/_replicate -d "@replicate.json" - H "Content-Type: application/json" {"ok":true,"session_id":"59177fe2deb3464f5cb195bf017c5c31","source_last_seq":2," replication_id_version":2,"history":[{"session_id":"59177fe2deb3464f5cb195bf017c 5c31","start_time":"Thu, 05 Jul 2012 19:54:42 GMT","end_time":"Thu, 05 Jul 2012 19:54:42 GMT","start_last_seq":0,"end_last_seq":2,"recorded_seq":2,"missing_chec ked":1,"missing_found":1,"docs_read":1,"docs_written":1,"doc_write_failures":0}] } C:\Users\jeheydor\Desktop>curl -X GET %couch%/db-replica/1 {"error":"not_found","reason":"deleted"} C:\Users\jeheydor\Desktop>curl -X POST %couch%/db-replica -d "@test-doc.json" -H "Content-Type: application/json" {"ok":true,"id":"1","rev":"1-a422bdfbb43a534656f6c14b210ac65b"} C:\Users\jeheydor\Desktop>curl -X GET %couch%/db-replica/1 {"error":"not_found","reason":"deleted"} C:\Users\jeheydor\Desktop>curl -X POST %couch%/db-replica -d "@test-doc.json" -H "Content-Type: application/json" {"ok":true,"id":"1","rev":"3-176a1441a6fc8582ffff3c3abb12e13b"} C:\Users\jeheydor\Desktop>curl -X GET %couch%/db-replica/1 {"_id":"1","_rev":"3-176a1441a6fc8582ffff3c3abb12e13b","name":"test-doc","count" :0} Here are the contents of the two files I uploaded using curl -d: test-doc.json: {"_id":"1", "name":"test-doc", "count":0} replicate.json: {"source":"db", "target":"db-replica"} was: This is a bug which the team I work with found because we have a lot of unit tests which use CouchDB. To reproduce it, do the following: 1) Create a document in a database. 2) Delete that document. 3) Replicate that database to a second database. 4) Create that same document in the second database. Although CouchDB returns "ok":true, the document is not created (this is the bug). 5) Do step 4 again and the document is created. The following is my output from cmd.exe when I did the above steps using curl: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\jeheydor\Desktop>set couch=http://localhost:5984 C:\Users\jeheydor\Desktop>curl -X GET %couch% {"couchdb":"Welcome","version":"1.2.0"} C:\Users\jeheydor\Desktop>curl -X PUT %couch%/db {"ok":true} C:\Users\jeheydor\Desktop>curl -X PUT %couch%/db-replica {"ok":true} C:\Users\jeheydor\Desktop>curl -X POST %couch%/db -d "@test-doc.json" -H "Conten t-Type: application/json" {"ok":true,"id":"1","rev":"1-a422bdfbb43a534656f6c14b210ac65b"} C:\Users\jeheydor\Desktop>curl -X DELETE %couch%/db/1?rev="1-a422bdfbb43a534656f 6c14b210ac65b" {"ok":true,"id":"1","rev":"2-d015c0459177c2f893cc691f9144ca5e"} C:\Users\jeheydor\Desktop>curl -X POST %couch%/_replicate -d "@replicate.json" - H "Content-Type: application/json" {"ok":true,"session_id":"59177fe2deb3464f5cb195bf017c5c31","source_last_seq":2," replication_id_version":2,"history":[{"session_id":"59177fe2deb3464f5cb195bf017c 5c31","start_time":"Thu, 05 Jul 2012 19:54:42 GMT","end_time":"Thu, 05 Jul 2012 19:54:42 GMT","start_last_seq":0,"end_last_seq":2,"recorded_seq":2,"missing_chec ked":1,"missing_found":1,"docs_read":1,"docs_written":1,"doc_write_failures":0}] } C:\Users\jeheydor\Desktop>curl -X GET %couch%/db-replica/1 {"error":"not_found","reason":"deleted"} C:\Users\jeheydor\Desktop>curl -X POST %couch%/db-replica -d "@test-doc.json" -H "Content-Type: application/json" {"ok":true,"id":"1","rev":"1-a422bdfbb43a534656f6c14b210ac65b"} C:\Users\jeheydor\Desktop>curl -X GET %couch%/db-replica/1 {"error":"not_found","reason":"deleted"} C:\Users\jeheydor\Desktop>curl -X POST %couch%/db-replica -d "@test-doc.json" -H "Content-Type: application/json" {"ok":true,"id":"1","rev":"3-176a1441a6fc8582ffff3c3abb12e13b"} C:\Users\jeheydor\Desktop>curl -X GET %couch%/db-replica/1 {"_id":"1","_rev":"3-176a1441a6fc8582ffff3c3abb12e13b","name":"test-doc","count" :0} > Document creation fails after deleting and replicating > ------------------------------------------------------ > > Key: COUCHDB-1509 > URL: https://issues.apache.org/jira/browse/COUCHDB-1509 > Project: CouchDB > Issue Type: Bug > Components: HTTP Interface > Affects Versions: 1.2 > Environment: Windows 7 Enterprise. CouchDB 1.1 and 1.2 > Reporter: Joseph Heydorn > > This is a bug which the team I work with found because we have a lot of unit tests which use CouchDB. > To reproduce it, do the following: > 1) Create a document in a database. > 2) Delete that document. > 3) Replicate that database to a second database. > 4) Create that same document in the second database. Although CouchDB returns "ok":true, the document is not created (this is the bug). > 5) Do step 4 again and the document is created. > The following is my output from cmd.exe when I did the above steps using curl: > Microsoft Windows [Version 6.1.7601] > Copyright (c) 2009 Microsoft Corporation. All rights reserved. > C:\Users\jeheydor\Desktop>set couch=http://localhost:5984 > C:\Users\jeheydor\Desktop>curl -X GET %couch% > {"couchdb":"Welcome","version":"1.2.0"} > C:\Users\jeheydor\Desktop>curl -X PUT %couch%/db > {"ok":true} > C:\Users\jeheydor\Desktop>curl -X PUT %couch%/db-replica > {"ok":true} > C:\Users\jeheydor\Desktop>curl -X POST %couch%/db -d "@test-doc.json" -H "Conten > t-Type: application/json" > {"ok":true,"id":"1","rev":"1-a422bdfbb43a534656f6c14b210ac65b"} > C:\Users\jeheydor\Desktop>curl -X DELETE %couch%/db/1?rev="1-a422bdfbb43a534656f > 6c14b210ac65b" > {"ok":true,"id":"1","rev":"2-d015c0459177c2f893cc691f9144ca5e"} > C:\Users\jeheydor\Desktop>curl -X POST %couch%/_replicate -d "@replicate.json" - > H "Content-Type: application/json" > {"ok":true,"session_id":"59177fe2deb3464f5cb195bf017c5c31","source_last_seq":2," > replication_id_version":2,"history":[{"session_id":"59177fe2deb3464f5cb195bf017c > 5c31","start_time":"Thu, 05 Jul 2012 19:54:42 GMT","end_time":"Thu, 05 Jul 2012 > 19:54:42 GMT","start_last_seq":0,"end_last_seq":2,"recorded_seq":2,"missing_chec > ked":1,"missing_found":1,"docs_read":1,"docs_written":1,"doc_write_failures":0}] > } > C:\Users\jeheydor\Desktop>curl -X GET %couch%/db-replica/1 > {"error":"not_found","reason":"deleted"} > C:\Users\jeheydor\Desktop>curl -X POST %couch%/db-replica -d "@test-doc.json" -H > "Content-Type: application/json" > {"ok":true,"id":"1","rev":"1-a422bdfbb43a534656f6c14b210ac65b"} > C:\Users\jeheydor\Desktop>curl -X GET %couch%/db-replica/1 > {"error":"not_found","reason":"deleted"} > C:\Users\jeheydor\Desktop>curl -X POST %couch%/db-replica -d "@test-doc.json" -H > "Content-Type: application/json" > {"ok":true,"id":"1","rev":"3-176a1441a6fc8582ffff3c3abb12e13b"} > C:\Users\jeheydor\Desktop>curl -X GET %couch%/db-replica/1 > {"_id":"1","_rev":"3-176a1441a6fc8582ffff3c3abb12e13b","name":"test-doc","count" > :0} > Here are the contents of the two files I uploaded using curl -d: > test-doc.json: > {"_id":"1", "name":"test-doc", "count":0} > replicate.json: > {"source":"db", "target":"db-replica"} -- 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