You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2019/03/05 22:05:31 UTC

[GitHub] [couchdb] kocolosk commented on issue #1418: BUG: Recreating deleted document can break replication when VDU function is active

kocolosk commented on issue #1418: BUG: Recreating deleted document can break replication when VDU function is active
URL: https://github.com/apache/couchdb/issues/1418#issuecomment-469876889
 
 
   So I know this was filed a long time ago, but - what a fascinating bug report!
   
   I understand what's happening in @ondra-novak 's initial report, but it's not clear to me that @bravier is experiencing the same issue. In Ondra's case the validation failure happens because the replicator skips over the deletion, which means the target sees the old version (before the deletion) and the new version, and their `owner` fields don't match.
   
   In @bravier 's case there's a replication after every edit, so it's definitely a different situation. I'm wondering if in that situation `oldDoc` really _is_ present in the replicated edit path, and because the deletion did not keep the `name` property in the tombstone it fails to validate when the re-created doc shows up as an extension of the edit path. It's almost the converse of @ondra-novak 's report. Worth double-
   
   At a higher level ... I'm concerned a bit about the reliance on the presence of `oldDoc` in the VDU when a document was created without specifying any revision. Yes, in that case CouchDB will look to extend an existing edit branch, but I always thought of this as a performance optimization that was not intended to have user-facing consequences. Clearly it does, and folks are relying on it for reasonable use cases.
   
   Separately, at some point we blocked the ability to supply the `_rev` of a deleted leaf edit when *every* leaf of the document is deleted. It's possible that this happened in 39df1d5e78a3ffd. Oddly enough if some other branch of the document is not deleted we will let the operation against the deleted leaf go through. That seems like an unintentional inconsistency.
   
   I don't have a great answer about how to proceed here, but figured I should write down a few details that I picked up because I happened to be looking at this part of the codebase for #1957 and @wohali pointed me to this ticket as an interesting edge case.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services