You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Christian Siegert <ch...@christian-siegert.com> on 2010/08/30 10:20:59 UTC

_deleted_conflicts in CouchDB 0.10

Hi,

I use Ubuntu with CouchDB 0.10 (the most recent version available in the 
repository). When I create a document, delete it, and create a document 
with the same id but different content, I produce _deleted_conflicts.

Someone confirmed that this problem is also present in CouchDB 0.12. Is 
CouchDB 1.0.1 affected as well? ... Can I ignore this for the time being 
or does it have negative implications?


Here are the steps to replicate it:

// Create database "test-db"
$ curl -X "PUT" "http://localhost:5984/test-db"

// Create document with id "hello"
$ curl -X "PUT" -d '{"blah":"heee"}' "http://localhost:5984/test-db/hello"

// Delete the document (Replace {REVISION} with revision provided by the 
response when you created the document, do not put quotes around the 
revision)
$ curl -X "DELETE" "http://localhost:5984/test-db/hello?rev={REVISION}"

// Add document with id "hello" but different content than previously
$ curl -X "PUT" -d '{"blah":"bummer"}' "http://localhost:5984/test-db/hello"

// See if we created a conflict (Check if the field "_deleted_conflicts" 
is present)
$ curl -X "GET" "http://localhost:5984/test-db/hello?meta=true"


LOG
===

me@laptop:~$ curl -X "PUT" "http://localhost:5984/test-db"
{"ok":true}

me@laptop:~$ curl -X "PUT" -d '{"blah":"heee"}' 
"http://localhost:5984/test-db/hello"
{"ok":true,"id":"hello","rev":"1-eedd5293adfba3e6756d169279c9e258"}

me@laptop:~$ curl -X "DELETE" 
"http://localhost:5984/test-db/hello?rev=1-eedd5293adfba3e6756d169279c9e258"
{"ok":true,"id":"hello","rev":"2-812b533fc2804799136e1a2835a2a11b"}

me@laptop:~$ curl -X "PUT" -d '{"blah":"bummer"}' 
"http://localhost:5984/test-db/hello"
{"ok":true,"id":"hello","rev":"1-8f516938fadd326bee9940f267d91b30"}

me@laptop:~$ curl -X "GET" "http://localhost:5984/test-db/hello?meta=true"
{"_id":"hello","_rev":"1-8f516938fadd326bee9940f267d91b30","blah":"bummer","_revs_info":[{"rev":"1-8f516938fadd326bee9940f267d91b30","status":"available"}],"_deleted_conflicts":["2-812b533fc2804799136e1a2835a2a11b"]}