Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 00E61D141 for ; Tue, 18 Dec 2012 13:39:53 +0000 (UTC) Received: (qmail 45667 invoked by uid 500); 18 Dec 2012 13:39:51 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 45637 invoked by uid 500); 18 Dec 2012 13:39:51 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 45625 invoked by uid 99); 18 Dec 2012 13:39:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Dec 2012 13:39:51 +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 (nike.apache.org: domain of stefan.guggisberg@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; Tue, 18 Dec 2012 13:39:43 +0000 Received: by mail-ob0-f177.google.com with SMTP id uo13so608498obb.36 for ; Tue, 18 Dec 2012 05:39:22 -0800 (PST) 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:content-transfer-encoding; bh=52Jh85sWJN0RweLKP3BJ8wTG3N6VnWLMarvjJ/dl6YY=; b=ioiN59jpu7wgR/MOPfeMDUse/oyX+qVpP0lK+V5CMxrbi77aY4OcOd5upxd3fsDeU6 J5pEa7w4pYzrUNMO9HPTBFfrhkaMvLUcqHe3ytO4T3Vdhdgn5oNubxHsTz5X3HxRWOIe 5ZI/ZHstEElkKfodRHeLqDDkqJT3x2Mz3sR9KUNrRGqEDsKrx3cb+jCm4ZerhyEx9dQ1 rY3vx7TsjoMsaZVsSpwX59RuGOeFt5BVeD+unB3u9D0Gg+qlS9HNDOsw8pmbhVQZQAvs b+E3IP3eKU6fns2oJS8fWVGf8nT0YBUJpLOrYieESGLUJOM6Dmy8Tyx3zpLWtDuisowM MYag== MIME-Version: 1.0 Received: by 10.182.73.4 with SMTP id h4mr1541923obv.18.1355837962553; Tue, 18 Dec 2012 05:39:22 -0800 (PST) Received: by 10.76.73.129 with HTTP; Tue, 18 Dec 2012 05:39:22 -0800 (PST) In-Reply-To: <50D06FE5.9070107@gmail.com> References: <50C8A6CD.6070809@apache.org> <50D06FE5.9070107@gmail.com> Date: Tue, 18 Dec 2012 14:39:22 +0100 Message-ID: Subject: Re: Conflict handling in Oak From: Stefan Guggisberg To: "oak-dev@jackrabbit.apache.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Dec 18, 2012 at 2:30 PM, Michael D=FCrig wrote: > > > On 18.12.12 11:30, Stefan Guggisberg wrote: >> >> On Wed, Dec 12, 2012 at 4:46 PM, Michael D=FCrig wr= ote: >>> >>> Hi, >>> >>> Currently the Microkernel contract does not specify a merge policy but = is >>> free to try to merge conflicting changes or throw an exception. I think >>> this >>> is problematic in various ways: >>> >>> 1) Automatic merging may violate the principal of least surprise. It ca= n >>> be >>> arbitrary complex and still be incorrect wrt. different use cases which >>> need >>> different merge strategies for the same conflict. >>> >>> 2) Furthermore merges should be correctly mirrored in the journal. >>> According >>> to the Microkernel API: "deleting a node is allowed if the node existed >>> in >>> the given revision, even if it was deleted in the meantime." So the >>> following should currently not fail (it does though, see OAK-507): >>> >>> String base =3D mk.getHeadRevision(); >>> String r1 =3D mk.commit("-a", base) >>> String r2 =3D mk.commit("-a", base) >>> >>> At this point retrieving the journal up to revision r2 should only >>> contain a >>> single -a operation. I'm quite sure this is currently not the case and >>> the >>> journal will contain two -a operations. One for revision r1 and another >>> for >>> revision r2. >> >> >> if that's the case then it's a bug. the journal must IMO contain the exa= ct >> diff >> from a revision to its predecessor. > > > See OAK-532. thanks stefan > > Michael > > >> >> cheers >> stefan >> >>> >>> 3) Throwing an unspecific MicrokernelException leaves the API consumer >>> with >>> no clue on what caused a commit to fail. Retrying a commit after some >>> client >>> side conflict resolution becomes a hit and miss. See OAK-442. >>> >>> >>> To address 1) I suggest we define a set of clear cut cases where any >>> Microkernel implementations MUST merge. For the other cases I'm not sur= e >>> whether we should make them MUST NOT, SHOULD NOT or MAY merge. >>> >>> To address 2) My preferred solution would be to drop getJournal entirel= y >>> from the Microkernel API. However, this means rebasing a branch would >>> need >>> to go into the Microkernel (OAK-464). Otherwise every merge defined for >>> 1) >>> would need to take care the journal is adjusted accordingly. >>> Another possibility here is to leave the journal unadjusted. However th= en >>> we >>> need to specify MUST NOT for other merges in 1). Because only then can >>> clients of the journal know how to interpret the journal (receptively t= he >>> conflicts contained therein). >>> >>> To address 3) I'd simply derive a more specific exception from >>> MicroKernelException and throw that in the case of a conflict. See >>> OAK-496. >>> >>> Michael