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 19:05:12 UTC

[GitHub] [couchdb] kocolosk edited a comment on issue #1957: Data model for storing revision history in FoundationDB

kocolosk edited a comment on issue #1957: Data model for storing revision history in FoundationDB
URL: https://github.com/apache/couchdb/issues/1957#issuecomment-469815896
 
 
   I updated the text of the proposal to incorporate the details from my last comment.
   
   Separately, @wohali pointed me to an old bug report in #1418 which has some bearing here. It seems that we are currently rather inconsistent in how we handle attempts to extend a tombstoned edit branch. If *every* branch in the document is tombstoned, we reject edit attempts that specify an explicit `_rev` with a conflict. But if at least one branch is `deleted=false`, we will allow other tombstoned branches to be extended. This is inconsistent and seemingly unintentional behavior.
   
   The proposed data model is most efficient if we block all explicit updates to tombstoned edit branches (i.e., updates that supply the `_rev` of the tombstone as a base). If we do need to support the current CouchDB behavior, it will require attempting to read 3 KVs for every edit that gets rejected with a conflict: the `deleted=false` KV for that revision, the `deleted=true` KV for that revision, and the last KV for the document (to see if all branches are `deleted=true`). We would likely do this in 2 roundtrips to avoid paying the extra cost on every edit. It's doable, but I think we may want to take this opportunity to make our API more consistent. I've updated the proposal to point us in that direction.
   
   Digging even deeper, folks should be aware that when users create a new document (with no `_rev`) over top of a document where all branches are tombstoned, current CouchDB will internally extend the "winning" tombstoned branch with the new edit. I believe this was intended solely as a performance optimization, to avoid creating a too-wide revision tree, but as #1418 makes clear this optimization has real user-visible implications in the API. The data model in this RFC naturally supports the same optimization. We can have a detailed discussion of what we think the right behavior ought to be going forward, but I don't think it should hold up the decision on the data model.

----------------------------------------------------------------
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