You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Klaus Trainer (JIRA)" <ji...@apache.org> on 2010/10/16 21:42:22 UTC
[jira] Commented: (COUCHDB-902) Attachments that have recovered
from conflict do not accept attachments.
[ https://issues.apache.org/jira/browse/COUCHDB-902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921743#action_12921743 ]
Klaus Trainer commented on COUCHDB-902:
---------------------------------------
I've figured out what the actual problem here is.
========================================================================
Deleting conflicts on database two:
========================================================================
GET - /two/test?conflicts=true - "some plain text"
200 - {"_id":"test","_rev":"2-871d61d84063e8fc02d64acbcdaad8ba","foo":3,"_conflicts":["2-2ee767305024673cfb3f5af037cd2729"]}
DELETE - /two/test?rev=2-2ee767305024673cfb3f5af037cd2729 -
200 - {"ok":true,"id":"test","rev":"3-89c964c5556795ee0fc45fd5213013b4"}
========================================================================
Attaching to document without conflicts on database two:
========================================================================
GET - /two/test - "some plain text"
200 - {"_id":"test","_rev":"2-871d61d84063e8fc02d64acbcdaad8ba","foo":3}
PUT - /two/test/some_attachment?rev=2-871d61d84063e8fc02d64acbcdaad8ba - some plain text
409 - {"error":"conflict","reason":"Document update conflict."}
The problem is that when deleting the conflicting revision 2-2ee767305024673cfb3f5af037cd2729, just a new revision 3-89c964c5556795ee0fc45fd5213013b4 (with "_deleted":true) is created. The old revision 2-871d61d84063e8fc02d64acbcdaad8ba (that's not been deleted) is now in a kind of "deleted conflict" state with it. That is, updating revision 2-871d61d84063e8fc02d64acbcdaad8ba would create a new revision that's in conflict with the deleted one.
You can check this e.g. with
curl -X GET http://127.0.0.1:5984/two/test?deleted_conflicts=true
{"_id":"test","_rev":"2-871d61d84063e8fc02d64acbcdaad8ba","foo":3,"_deleted_conflicts":["3-89c964c5556795ee0fc45fd5213013b4"]}
The actual problem here is that when updating a document with an attachment, deleted conflicts are treated like normal conflicts. Supposably there's an easy solution to that issue.
> Attachments that have recovered from conflict do not accept attachments.
> ------------------------------------------------------------------------
>
> Key: COUCHDB-902
> URL: https://issues.apache.org/jira/browse/COUCHDB-902
> Project: CouchDB
> Issue Type: Bug
> Components: Database Core
> Environment: trunk
> Reporter: Paul Joseph Davis
> Priority: Critical
> Attachments: couchdb-902-test-case.py
>
>
> Apparently if a document has been in a conflict, they will reject requests to add an attachment with a conflict error.
> I've tracked this down to couch_db_updater.erl line 501, but I'm not too familiar with this part of the code so I figured I'd fill out a ticket in case anyone else can go through this more quickly than me.
> Sure would be nice if I could attach a file when I create an issue...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.