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 8ED0111B0A for ; Mon, 22 Sep 2014 18:55:47 +0000 (UTC) Received: (qmail 66061 invoked by uid 500); 22 Sep 2014 18:55:46 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 66001 invoked by uid 500); 22 Sep 2014 18:55:46 -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 65988 invoked by uid 99); 22 Sep 2014 18:55:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2014 18:55:46 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of siriele2x3@gmail.com designates 209.85.216.53 as permitted sender) Received: from [209.85.216.53] (HELO mail-qa0-f53.google.com) (209.85.216.53) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2014 18:55:42 +0000 Received: by mail-qa0-f53.google.com with SMTP id cm18so564580qab.26 for ; Mon, 22 Sep 2014 11:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=TIO96nCREYXVR5Fw0340ZDXcQtxQYMTx3P8x38/LT5E=; b=g4mTOySfTUVpIuV8weKMg5sdSi1ZQucn4PdUhRR1huVqh/FLjmIOSO9Jhn4BW4nfaf EEWzQchfPmF9jibh+kJEmXhZHcJbGMZkl8cRG1twEspVBPJzEr9zndjWpUks5zmYhhaN a5+3Rp9T/N7W/CP6Q31cEkk01LeoJodus88Rl7v3GoB+ZyMB3+YXSeKyTsQNK5cfnmjp FY/D0zC6oaYxa9HCmRNZD0wCNKajdkS9y8zjoMjxnVW/atIyU0GMXTHQAMNE7cW22s95 5c5L9ms0rNUz9BEz+6dB2f1qN43EGuYkVQ06mjBsofipKewddO8GaubhuVZA4MO5h3h4 VINA== MIME-Version: 1.0 X-Received: by 10.224.36.73 with SMTP id s9mr8382203qad.82.1411412121535; Mon, 22 Sep 2014 11:55:21 -0700 (PDT) Received: by 10.96.176.162 with HTTP; Mon, 22 Sep 2014 11:55:21 -0700 (PDT) Received: by 10.96.176.162 with HTTP; Mon, 22 Sep 2014 11:55:21 -0700 (PDT) In-Reply-To: <19628772.99.1411409304608.JavaMail.jtouzet@jtouzet> References: <1411378631685.99672@here.com> <19628772.99.1411409304608.JavaMail.jtouzet@jtouzet> Date: Mon, 22 Sep 2014 11:55:21 -0700 Message-ID: Subject: Re: Union functions From: Stanley Iriele To: user@couchdb.apache.org, Joan Touzet Content-Type: multipart/alternative; boundary=089e014947f822cab10503abfe96 X-Virus-Checked: Checked by ClamAV on apache.org --089e014947f822cab10503abfe96 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I remember that discussion... Asking the database to auto resolve is an intractable problem for a distributed system... But providing a function that executes on read when conflicts=3D true that his. Coded and specified = by the end user is a totally different ask... And I believe would help couchdb instead of forcing the developer to pull out the docs and run the merge them selves... It could return in a header...the deleted revisions that lost or something...who knows... Bit that's the jist On Sep 22, 2014 11:16 AM, "Joan Touzet" wrote: > All, this has been discussed in a previous thread on the mailing list a > couple of weeks ago. Some serious concerns were raised - especially how > this works with replication and in clusters, where race conditions can > occur. > > I encourage you to dig through the archives and to understand why this is > a non-trivial problem with some unsolveable constraints... > > -Joan > > ----- Original Message ----- > From: "Hector Sanjuan" > To: user@couchdb.apache.org > Sent: Monday, September 22, 2014 5:37:12 AM > Subject: Re: Union functions > > I would also like this feature (providing function is a fashion similar t= o > views would be nice). > > A couple of weeks ago I proposed adding a feature to autoresolve conflict= s > by just picking the winning revision and discarding the old... and this i= s > basicly the generalization of it. Instead of saving conflicted revisions, > just apply a user's provided function and save whatever comes out of it. > > H > ________________________________________ > From: Stanley Iriele > Sent: Monday, September 22, 2014 09:08 > To: user@couchdb.apache.org > Subject: Re: Union functions > > Hey...thanks for your response. Somewhere in the mix I mentioned vector > clocks being returned as well. You shouldn't need the ancestor doc...just > what it holds as a collision. Your function should be able to given 2 doc= s > and a vector clocks be able to resolve the conflict. > > This can take many angles and forms but the idea is ...either have this > function run when faced with collisions on write... Or...on read... With = a > query of conflicts =3D true..have a union function specified in the URL t= o > resolve it before it makes it to the show function or is returned. > > I am kind of surprised at the seeming lack of interest in such a thing. > Riak supposedly got something like this. ...its not quite what I am > suggesting but its close.. Anyways....food for thought > On Sep 18, 2014 9:03 AM, "Aur=C3=A9lien B=C3=A9nel" wrote: > > > >>> Couchdb is an ap system... And stores the result of both docs duri= ng > > a conflict. We have update functions as a way to do incremental > updates. > > And show functions to do a transform on a doc before sending it. Can we > > have union functions to resolve a conflict between 2 docs?...I > > > > > > Err... Shouldn't we need the common ancestor document too? > > > > Let's suppose that a document {"name": "Bond", code: "007"} > > is updated in parallel as {"name": "Bond"} (for security reasons) > > and as {"name": "James Bond", code: "007"} (for civility reasons). > > > > We need the ancestor document to know that his "code" was deleted and > that > > "James Bond" is the right name. > > > > > > Regards, > > > > Aur=C3=A9lien > > > > > --089e014947f822cab10503abfe96--