Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 23B401075C for ; Sun, 1 Jun 2014 17:35:44 +0000 (UTC) Received: (qmail 19349 invoked by uid 500); 1 Jun 2014 17:35:43 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 19288 invoked by uid 500); 1 Jun 2014 17:35:43 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 19278 invoked by uid 99); 1 Jun 2014 17:35:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jun 2014 17:35:43 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jens@couchbase.com designates 199.193.200.192 as permitted sender) Received: from [199.193.200.192] (HELO hub029-va-1.exch029.serverdata.net) (199.193.200.192) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jun 2014 17:35:36 +0000 Received: from [10.0.1.9] (173.228.7.198) by east.exch029.serverdata.net (10.216.105.31) with Microsoft SMTP Server (TLS) id 14.3.174.1; Sun, 1 Jun 2014 10:35:12 -0700 Content-Type: text/plain; charset="windows-1252" MIME-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: Proposal for new feature: Auto Update Functions From: Jens Alfke In-Reply-To: <0E0EB900-18CC-42B2-B695-F1A66D6C1C4B@apache.org> Date: Sun, 1 Jun 2014 10:35:09 -0700 Content-Transfer-Encoding: quoted-printable Message-ID: References: <5389CC71.3050109@nospam.yrnm.net> <25393204.61.1401563211286.JavaMail.jtouzet@jtouzet> <0E0EB900-18CC-42B2-B695-F1A66D6C1C4B@apache.org> To: X-Mailer: Apple Mail (2.1878.2) X-Virus-Checked: Checked by ClamAV on apache.org On May 31, 2014, at 2:30 PM, Robert Samuel Newson = wrote: > The main trouble is loops. If couchdb edits the doc after the user = edits it, this edit is also replicated out to wherever you replicate to, = which will make this edit again, and then back again, and then back = again. I agree =97 this has some problematic interactions with the replicator. If a document is replicated to two databases, and one of them uses this = feature to modify the document, the destination databases now contain = two documents with the same doc and revision ID but different contents. = That explicitly breaks one of the invariants the replicator relies on. (The same issue applies if both databases use this feature, but don=92t = make identical changes. This could happen even if they=92re both using = identical auto-update functions, e.g. if the auto-update adds a = timestamp or a randomly-generated identifier.) This can be averted if the auto-update is only used in the case where = new_edits=3Dtrue, i.e. a normal PUT. Both because the replicator doesn=92t= use this mode, and because this mode assigns a new revID, so it can be = based on the post-processed doc=92s contents. =97Jens=