Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 83020D90E for ; Sat, 18 May 2013 08:56:14 +0000 (UTC) Received: (qmail 68318 invoked by uid 500); 18 May 2013 08:56:14 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 67966 invoked by uid 500); 18 May 2013 08:56:08 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 67917 invoked by uid 99); 18 May 2013 08:56:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 May 2013 08:56:06 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of randall.leeds@gmail.com designates 209.85.214.177 as permitted sender) Received: from [209.85.214.177] (HELO mail-ob0-f177.google.com) (209.85.214.177) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 May 2013 08:56:01 +0000 Received: by mail-ob0-f177.google.com with SMTP id wn6so5166148obc.8 for ; Sat, 18 May 2013 01:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=RnKqD4Up0ms4wSw3zrFs1v9audCQAZ7v/AzHq2MTgNM=; b=E16eYTm7pRyqbCpAGavERMxyZMINId5nViWxHhnHS3eNGrl5vtWr86OGzQxwoKTFQe o+f7HhAjbG0JtQ13Fi2AhWXhE1K98N1dFXCH/jFJo3Ao5rCVb+2YEUEPFD3K/Rpbb98q 1tCcecXHiWAse+wLUv8sEOXIukQKi5D/UWonLEg0rhI7TNk2/dN3kiubvWRcUp9XwZLN blQkKvE/8ASD/mzQW1Z/14vyG0ErSOckkct2mdxnKMkNT84l49DEzbhbdGkSXxfStBgz hP8PLv0x2wFZdkT/kzPIT34Bif3YFdaiSqRZWoT+eFR+CpqjcHvxs858mH2zUOnyuO6m 6AgA== MIME-Version: 1.0 X-Received: by 10.182.44.165 with SMTP id f5mr22508073obm.26.1368867341155; Sat, 18 May 2013 01:55:41 -0700 (PDT) Received: by 10.76.29.50 with HTTP; Sat, 18 May 2013 01:55:41 -0700 (PDT) In-Reply-To: References: <20130516144732.0dda4bbf@svilendobrev.com> <70BAE84F-500B-4372-A81D-EABDD80B5A0B@sri.com> <89B403E2-01B6-472C-87B3-D77F3E8BB90E@sri.com> Date: Sat, 18 May 2013 01:55:41 -0700 Message-ID: Subject: Re: Deleted and Replacement documents and VDU behavior From: Randall Leeds To: "dev@couchdb.apache.org" Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org On Fri, May 17, 2013 at 12:12 PM, Randall Leeds wrote: > On Fri, May 17, 2013 at 11:57 AM, Robert Newson wrote: >> 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. > > I know we have a clause for revivification for an update without a rev > to a deleted doc. > > This proposed alternative behavior is attractive to me and if my > armchair spelunking is correct, it's actually pretty trivial. It seems > to me like we could even make a minor breaking change for 1.4 where > the old doc is always passed to VDU handlers, even if it's a > tombstone. Migration would mean updating VDU handlers to consider > oldDoc._deleted. I think many are probably using VDUs for validating > the new doc anyway, and would ignore the second parameter. > > The default semantics could stay the same, but if we just passed the > tombstone to VDU handlers it would be customizable in exactly the way > Jim wants. Sounds exactly like the sort of thing VDU is for. I just realized that it's not clear which revision should be provided when attempting to revive a deleted doc, since there may have been several revision histories which ended in deletes and there is no previous rev specified.