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 099829961 for ; Sun, 8 Apr 2012 09:40:42 +0000 (UTC) Received: (qmail 21543 invoked by uid 500); 8 Apr 2012 09:40:40 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 21453 invoked by uid 500); 8 Apr 2012 09:40:40 -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 21437 invoked by uid 99); 8 Apr 2012 09:40:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Apr 2012 09:40:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Apr 2012 09:40:38 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 471AC35DF5C for ; Sun, 8 Apr 2012 09:40:17 +0000 (UTC) Date: Sun, 8 Apr 2012 09:40:17 +0000 (UTC) From: "Unico Hommes (Commented) (JIRA)" To: dev@jackrabbit.apache.org Message-ID: <237744631.684.1333878017308.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <2006485076.675.1333877898544.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (JCR-3289) Concurrent remove operation right after move operation causes missing child inconsistency MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/JCR-3289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13249510#comment-13249510 ] Unico Hommes commented on JCR-3289: ----------------------------------- Patches against 2.4.1 tag > Concurrent remove operation right after move operation causes missing child inconsistency > ----------------------------------------------------------------------------------------- > > Key: JCR-3289 > URL: https://issues.apache.org/jira/browse/JCR-3289 > Project: Jackrabbit Content Repository > Issue Type: Bug > Affects Versions: 2.4 > Reporter: Unico Hommes > Priority: Critical > Fix For: 2.4.2 > > Attachments: ConcurrentAddMoveRemoveTest.patch, ItemSaveOperation.patch > > > The scenario is as follows: > 1. Thread thr1 does a move operation on node /folder1/node to destination /folder2/node > 2. Thread thr2 does a remove operation on node /folder1/node > 3. Thread thr1 does session save > 4. Thread thr2 does session save > A consistency check shows that /folder2 has a child node entry for inexistent child node node. > The problem is that step 4. should fail whereas it doesn't. > This is caused by the fact that the ItemSaveOperation.removeTransientItems puts the overlayed state of the transient state in the changelog instead of the transient state itself. But the overlayed state has the updated modcount of the previous move operation. Therefore when the shared item state manager persists the changelog it doesn't detect that the remove was done on a stale item and so the update can succeed. > Attached is a patch containing a testcase that reproduces the inconsistency with this scenario. > The test creates two nodes /folder1 and /folder2 and then executes the following operations concurrently: > 1. add a node to either /folder1 or /folder2 > 2. remove a node from either /folder1 or /folder2 > 3. move a node from either /folder1 to /folder2 or vice versa > On tearDown the workspace is checked for inconsistencies. > Another patch is for the ItemSaveOperation class which fixes the issue. It's a proposed solution and I am not sure if this class is the right place to throw a StaleItemException or if there is a better solution than this but it is a proof of concept at the least. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira