couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
Subject Re: Deleted and Replacement documents and VDU behavior
Date Fri, 17 May 2013 18:57:26 GMT
oldDoc is null in this case. That matches the case that the doc is
brand new and is surely deliberate? I asked him to post it this here
because I do understand the benefits of it being otherwise and wanted
to see this conversation.

My position is that deleting a document should free that id for any
future use, which is exactly what Jim does not want.

I'd like to hear from folks that might have a memory of when this
particular semantic was decided. I think it could arguably have gone
the other way.



On 17 May 2013 19:52, Randall Leeds <randall.leeds@gmail.com> wrote:
> 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