[ https://issues.apache.org/jira/browse/COUCHDB-1509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408078#comment-13408078 ]
Joseph Heydorn commented on COUCHDB-1509: ----------------------------------------- I put all the curl commands in a batch script, then added ?meta=true to the last GET command. Here is the response it gave me: {"_id":"1","_rev":"3-176a1441a6fc8582ffff3c3abb12e13b","name":"test-doc","count" :0,"_revs_info":[{"rev":"3-176a1441a6fc8582ffff3c3abb12e13b","status":"available "},{"rev":"2-d015c0459177c2f893cc691f9144ca5e","status":"deleted"},{"rev":"1-a42 2bdfbb43a534656f6c14b210ac65b","status":"available"}]} I also deleted the both databases (db and db-replica) before the other curl commands to make sure there were no old revisions causing trouble. > 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