couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randall Leeds <randall.le...@gmail.com>
Subject Re: Deleted and Replacement documents and VDU behavior
Date Fri, 17 May 2013 18:52:45 GMT
On Fri, May 17, 2013 at 10:03 AM, Jim Klo <jim.klo@sri.com> wrote:
> So Bob suggested that I raise this topic over hereā€¦ Attaching the relevant
> thread from user@ here.
>
> I suppose this is a feature request to be able to optionally enable the
> passing of the document "stub" as the oldDoc, if exists to the VDU, if the
> design doc contains a flag to enable this behavior.
>
> I have a couple use cases:
> 1. DCMA takedown; I want to add additional data to the deleted marker, that
> would permit the VDU to inspect the deleted "stub" doc for the additional
> data and determine whether to permit the reinstatement of the doc.
> 2. Want to prevent reuse of an _id.  I want docs to be immutable except for
> a one time delete.
>
> In response to Bob's last response on user@ is how is this behavior any
> different than an document update?  My workaround is that I don't actually
> delete documents, but just update them into a "tombstone" document that
> removes the contents and then add the extra details I need for the VDU to
> work.  The major difference is that I must encode logic into my views to
> avoid the tombstone document which adds some unneeded complexity to the
> potentially every view.  My case is not so bad in that all my documents are
> 'typed' so my tombstone documents change the type such that they are
> excluded from views - however I had to carefully check to ensure that was
> the case.
>
> Thoughts, explanation why this is bad, etc?

Are we not passing the old doc (when deleted) to the VDU currently? It
seems like perhaps we should.

The only other piece that would need to change if you use regular
DELETEs with a tombstone body would be to ensure the tombstone doesn't
disappear. I'm not sure currently whether or not the tombstones
survive compaction, for instance. I suspect they do.

Mime
View raw message