Return-Path: X-Original-To: apmail-jackrabbit-dev-archive@www.apache.org Delivered-To: apmail-jackrabbit-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 2B0D579F4 for ; Thu, 1 Dec 2011 13:35:42 +0000 (UTC) Received: (qmail 38210 invoked by uid 500); 1 Dec 2011 13:35:41 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 38178 invoked by uid 500); 1 Dec 2011 13:35:41 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 38170 invoked by uid 99); 1 Dec 2011 13:35:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 13:35:41 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of stefan.guggisberg@gmail.com designates 209.85.161.170 as permitted sender) Received: from [209.85.161.170] (HELO mail-gx0-f170.google.com) (209.85.161.170) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 13:35:37 +0000 Received: by ggnv1 with SMTP id v1so2026867ggn.1 for ; Thu, 01 Dec 2011 05:35:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=uVbNPloNFaS+3uIjUsXPyOn9x4Gv7ATN4eTOg2d5qX4=; b=opGRHbA3KvSwzKkFGVIMyCEnOtPrlGC2f/Fn583hGYkc7Ju4LByfgCi4gmxiSPWnZJ Y+tGLubp3ljaM75jK4EZGYkYB89p4MXmNmNpcfRiP5/5drDYKYwPMSkSm57IKOEzhsCo KrZYO5Icd4Vtzc0QU6lqrMooN8rldOuGsS6g8= MIME-Version: 1.0 Received: by 10.50.242.1 with SMTP id wm1mr8870486igc.30.1322746516411; Thu, 01 Dec 2011 05:35:16 -0800 (PST) Received: by 10.42.213.7 with HTTP; Thu, 1 Dec 2011 05:35:16 -0800 (PST) In-Reply-To: <4ED7806E.5010402@apache.org> References: <4ED63BEE.6010904@apache.org> <4ED751DC.8070606@apache.org> <4ED76F55.3030001@apache.org> <4ED7806E.5010402@apache.org> Date: Thu, 1 Dec 2011 14:35:16 +0100 Message-ID: Subject: Re: [jr3 microkernel] Write skew From: Stefan Guggisberg To: dev@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Dec 1, 2011 at 2:26 PM, Michael D=FCrig wrote: > > On 1.12.11 13:01, Jukka Zitting wrote: >> >> Hi, >> >> On Thu, Dec 1, 2011 at 1:13 PM, Michael D=FCrig =A0w= rote: >>> >>> But this will introduce a race condition. With other words: this only >>> make >>> the time window during which such a inconsistency could slip in smaller= . >>> I >>> think what we'd really need is an atomic test and set operation. >> >> >> Right, either the refresh-check-persist model for save() needs to be >> atomic (possibly with optimistic locking as described) or we need an >> eventual consistency model that can automatically resolve such >> conflicts. >> >> Has this already been thought about? How does the current microkernel >> implementation handle such cases? > > > Currently the microkernel does nothing about this. That's what this whole > discussion is about after all ;-) and please bear in mind that the microkernel project in the jackrabbit sand= box is a prototype and represents WIP... ;) cheers stefan > > Eventually consistent approaches are IMO very hard to get right with JCR > since most operation are assumed to be persisted after dispatch. One > solution I see is to have changes caused by conflict resolution (i.e. dur= ing > convergence) to appear as normal changes as if they where done by other > sessions (see [1]). This would however require changing the revision mode= l > of the microkernel from linear shaped to tree shaped. > > For the current problem I'd rather have the microkernel to expose some > test-and-set semantics as Tom describes in [2]. That way a client of the > microkernel could apply changes atomically. > > A third and most general solution which puts away with write skew for goo= d > is described in [3]. This requires examining the commit log for certain > read-write conflicts on save. > > Michael > > [1] > http://wiki.apache.org/jackrabbit/Clustering%20the%20Microkernel#Replicat= ion > > [2] http://markmail.org/message/c32jpeoxklgcrybr > > [3] http://dl.acm.org/citation.cfm?id=3D1376690