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 5F25DE01F for ; Tue, 15 Jan 2013 11:19:55 +0000 (UTC) Received: (qmail 7796 invoked by uid 500); 15 Jan 2013 11:19:54 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 7673 invoked by uid 500); 15 Jan 2013 11:19:54 -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 7649 invoked by uid 99); 15 Jan 2013 11:19:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jan 2013 11:19:53 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.18.1.234] (HELO exprod6og119.obsmtp.com) (64.18.1.234) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jan 2013 11:19:44 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob119.postini.com ([64.18.5.12]) with SMTP ID DSNKUPU7O+r9kaDZSfPVuCeQoWzr5RbFxOjX@postini.com; Tue, 15 Jan 2013 03:19:24 PST Received: from inner-relay-1.corp.adobe.com ([153.32.1.51]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r0FBGN1v021222 for ; Tue, 15 Jan 2013 03:16:23 -0800 (PST) Received: from nacas01.corp.adobe.com (nacas01.corp.adobe.com [10.8.189.99]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r0FBJNAV015144 for ; Tue, 15 Jan 2013 03:19:23 -0800 (PST) Received: from eurhub01.eur.adobe.com (10.128.4.30) by nacas01.corp.adobe.com (10.8.189.99) with Microsoft SMTP Server (TLS) id 8.3.297.1; Tue, 15 Jan 2013 03:19:23 -0800 Received: from susi.local (10.136.133.173) by eurhub01.eur.adobe.com (10.128.4.111) with Microsoft SMTP Server id 8.3.297.1; Tue, 15 Jan 2013 11:19:21 +0000 Message-ID: <50F53B39.2060505@apache.org> Date: Tue, 15 Jan 2013 11:19:21 +0000 From: =?ISO-8859-1?Q?Michael_D=FCrig?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Subject: Re: MicroKernelIT#conflictingMove References: <9C0FC4C8E9C29945B01766FC7F9D3898173DA498CC@eurmbx01.eur.adobe.com> In-Reply-To: <9C0FC4C8E9C29945B01766FC7F9D3898173DA498CC@eurmbx01.eur.adobe.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 15.1.13 10:23, Marcel Reutegger wrote: > >> I looked into why 2 tests failing in MicroKernelIT for MongoMK. One of >> them is conflictingMove test. This test passes for MicroKernelImpl and it >> looks like the reason is MicroKernelImpl always commits against head. Take >> a look at CommitBuilder around line 112. There's a check whether baseRevId >> is not equal to currentHead, and if so, the staged tree is reset to >> currentHead and the operation is retried. This effectively means that the >> operation is committed against head, right? > > hmm, not sure. I'd first have to look at the code. if it just blindly commits to > head then it's certainly wrong and it also means it wouldn't detect the > conflict, right? So, I guess what it does is some kind of rebase. Yes, the H2 MK does some kind of rebase if the commit is not against the current head: it tries to reapply all changes against the current head an later tries to merge the resulting changes into trunk. However this results in a race condition. See https://issues.apache.org/jira/browse/OAK-532 > >> We recently changed CommitCommand to commit against baseRevisionId >> instead >> of head but I'm thinking maybe we should change it back to committing >> against head? Or maybe we commit against baseRevisionId but we add some >> kind of a conflicting commit detection (although I'm not too sure how we'd >> detect conflicting commits easily). WDYT? > > this is missing right now. merging with the *head* revision tree is done in > CommitCommandNew.mergeNodes(). that is, mergeNodes() basically does > the rebase I mentioned above. I recently added a FIXME to this method. > I think this is the place where we'd need to find out if there is a conflict. > In a nutshell here is what I think we should do: MK.commit should fail on all but conflicts which are trivially merged. This will not be a problem for oak-core since oak-core applies changes to private branches and will merge these on Session.save. Before merging, branches are rebased and that's the place where the more complicated conflict handling should go. Due to rebasing the subsequent merge will not conflict any more. See my POC work on https://issues.apache.org/jira/browse/OAK-536 for how such a rebase operation could look like. Note that the current implementation is not complete yet since it just throws an exception on conflicts. I will soon update this to a more complete implementation which correctly annotates conflicts such that oak-core can further handle these. Also note how such an implementation will also solve OAK-464 and OAK-548. Michael