[
https://issues.apache.org/jira/browse/COUCHDB-1396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13406795#comment-13406795
]
Robert Newson commented on COUCHDB-1396:
----------------------------------------
@Paul. Can we close this?
> Deleting a conflict revision will return a wrong current doc revision
> ---------------------------------------------------------------------
>
> Key: COUCHDB-1396
> URL: https://issues.apache.org/jira/browse/COUCHDB-1396
> Project: CouchDB
> Issue Type: Bug
> Components: Replication
> Reporter: Oliver Kurowski
> Priority: Minor
> Labels: conflict, replication, revision
>
> After deleting the current revision to make the conflict revision the winning
> one,
> the returned revisionnummer ("2-f4a2a6b0c7742a5e6dd7eea7a4b625a1") is not the
> revision number of the documen (1-45c1922c1b51dc5ee945218d63ce2ab4)
> echo $COUCH curly -X
> DELETE $COUCH/db1 curly -X
> DELETE $COUCH/db2 curly -X
> PUT $COUCH/db1
> curly -X PUT $COUCH/db2
> curly -X PUT $COUCH/db1/doc -d '{"wert":1}'
> curly -X PUT $COUCH/db2/doc -d '{"wert":2}'
> curly -X POST $COUCH/_replicate -d '{"source":"db1","target":"db2"}'
> curly $COUCH/db2/doc\?conflicts=true
> curly $COUCH/db2/doc\?revs=true
> curly -X DELETE $COUCH/db2/doc\?rev=1-97cea733330a7b8b41aae9e5732f4ac7
> curly $COUCH/db2/doc\?conflicts=true
> curly $COUCH/db2/doc\?revs=true curly $COUCH/db2/doc
> sendai ~ % echo $COUCH http://localhost:5984
> sendai ~ % curly -X DELETE $COUCH/db1
> { "ok" : true }
> sendai ~ % curly -X DELETE $COUCH/db2
> { "ok" : true }
> sendai ~ % curly -X PUT $COUCH/db1
> { "ok" : true }
> sendai ~ % curly -X PUT $COUCH/db2
> { "ok" : true }
> sendai ~ % curly -X PUT $COUCH/db1/doc -d '{"wert":1}'
> { "ok" : true, "rev" : "1-97cea733330a7b8b41aae9e5732f4ac7", "id" :
> "doc" }
> sendai ~ % curly -X PUT $COUCH/db2/doc -d '{"wert":2}'
> { "ok" : true, "rev" : "1-45c1922c1b51dc5ee945218d63ce2ab4", "id" :
> "doc" }
> sendai ~ % curly -X POST $COUCH/_replicate -d
> '{"source":"db1","target":"db2"}'
> { "ok" : true, "history" : [ { "docs_read" : 1,
> "session_id" : "7c74c9bb9f322e10ad072215e823c2d8", "recorded_seq" :
> 1, "end_last_seq" : 1, "doc_write_failures" : 0,
> "start_time" : "Mon, 30 Jan 2012 20:34:18 GMT", "start_last_seq" :
> 0, "end_time" : "Mon, 30 Jan 2012 20:34:18 GMT",
> "missing_checked" : 0, "docs_written" : 1, "missing_found"
> : 1 } ], "session_id" : "7c74c9bb9f322e10ad072215e823c2d8",
> "source_last_seq" : 1, "replication_id_version" : 2 }
> sendai ~ % curly $COUCH/db2/doc\?conflicts=true
> { "_id" : "doc", "wert" : 1, "_conflicts" : [
> "1-45c1922c1b51dc5ee945218d63ce2ab4" ], "_rev" :
> "1-97cea733330a7b8b41aae9e5732f4ac7" }
> sendai ~ % curly $COUCH/db2/doc\?revs=true
> { "_id" : "doc", "wert" : 1, "_revisions" : { "ids" : [
> "97cea733330a7b8b41aae9e5732f4ac7" ], "start" : 1 },
> "_rev" : "1-97cea733330a7b8b41aae9e5732f4ac7" }
> sendai ~ % curly -X DELETE
> $COUCH/db2/doc\?rev=1-97cea733330a7b8b41aae9e5732f4ac7
> { "ok" : true, "rev" : "2-f4a2a6b0c7742a5e6dd7eea7a4b625a1", "id" :
> "doc" }
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> sendai ~ % curly $COUCH/db2/doc\?conflicts=true { "_id" : "doc", "wert"
> : 2, "_rev" : "1-45c1922c1b51dc5ee945218d63ce2ab4" }
> sendai ~ % curly $COUCH/db2/doc\?revs=true { "_id" : "doc", "wert" : 2,
> "_revisions" : { "ids" : [
> "45c1922c1b51dc5ee945218d63ce2ab4" ], "start" : 1 }, "_rev"
> : "1-45c1922c1b51dc5ee945218d63ce2ab4" }
> sendai ~ % curly $COUCH/db2/doc { "_id" : "doc", "wert" : 2, "_rev"
> : "1-45c1922c1b51dc5ee945218d63ce2ab4" }
> sendai ~ %
--
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