You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Stephan Huttenhuis (JIRA)" <ji...@apache.org> on 2010/04/09 15:39:50 UTC

[jira] Created: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Saving concurrent sessions executing random operations causes a corrupt JCR
---------------------------------------------------------------------------

                 Key: JCR-2598
                 URL: https://issues.apache.org/jira/browse/JCR-2598
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-core
    Affects Versions: 2.0.0, 1.6.1
            Reporter: Stephan Huttenhuis


Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-2598:
-------------------------------

           Status: Resolved  (was: Patch Available)
         Assignee: Jukka Zitting
    Fix Version/s: 2.1.1
                   2.2.0
       Resolution: Fixed

The remaining problems got fixed in JCR-2579.

I merged these changes also to the 2.1 branch for the 2.1.1 release.

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>            Assignee: Jukka Zitting
>             Fix For: 2.1.1, 2.2.0
>
>         Attachments: ConcurrencyTest3.java, JCR-2598-II.patch, JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-2598:
-------------------------------

    Fix Version/s: 2.0.2

Merged to the 2.0 branch in revision 982274.

I'll take a look at backporting this also to 1.6.3.

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>            Assignee: Jukka Zitting
>             Fix For: 1.6.3, 2.0.2, 2.1.1, 2.2.0
>
>         Attachments: ConcurrencyTest3.java, JCR-2598-II.patch, JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Stephan Huttenhuis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan Huttenhuis updated JCR-2598:
------------------------------------

    Attachment:     (was: GXWMF-754-II.patch)

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>         Attachments: ConcurrencyTest3.java, JCR-2598-II.patch, JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Stephan Huttenhuis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan Huttenhuis updated JCR-2598:
------------------------------------

    Attachment: ConcurrencyTest3.java

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>         Attachments: ConcurrencyTest3.java, JCR-2598-II.patch, JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Köll updated JCR-2598:
----------------------------

    Fix Version/s: 1.6.3

Would be fine to have this changes in 1.6.3 too.

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>            Assignee: Jukka Zitting
>             Fix For: 1.6.3, 2.1.1, 2.2.0
>
>         Attachments: ConcurrencyTest3.java, JCR-2598-II.patch, JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Stephan Huttenhuis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan Huttenhuis updated JCR-2598:
------------------------------------

    Attachment:     (was: JCR-2598.patch)

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>         Attachments: JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918521#action_12918521 ] 

Jukka Zitting commented on JCR-2598:
------------------------------------

> Should we add the ConcurrencyTest3 to a TestSuite?

AFAICT there are no assertions in the test case, so for now it only makes sense to run the test manually on demand.

Should the test case be modified to automatically detect and report failures, then it would be good to have it as a part of the test suite. However, since the test is pretty expensive, it should only be run within the integrationTesting profile.


> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>            Assignee: Jukka Zitting
>             Fix For: 1.6.4, 2.0.3, 2.1.1, 2.2.0
>
>         Attachments: ConcurrencyTest3.java, JCR-2598-II.patch, JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Stephan Huttenhuis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan Huttenhuis updated JCR-2598:
------------------------------------

    Attachment:     (was: ConcurrencyTest3.java)

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>         Attachments: JCR-2598-II.patch, JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Stephan Huttenhuis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan Huttenhuis updated JCR-2598:
------------------------------------

    Attachment: JCR-2598.patch

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>         Attachments: JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Stephan Huttenhuis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan Huttenhuis updated JCR-2598:
------------------------------------

    Attachment: GXWMF-754-II.patch

I performed a small performance test using the attached unit test. I measured the System.currentTimeMillis() before and after a call to validateHierarchy. My test machine has the following specs: Windows XP Pro SP3 / Intel Core2 CPU 6300 @1.86GHz / 3 GB RAM.

The unit test has the following parameters:
iterations : amount of test runs
thread size: amount of threads during a run
run size   : amount of session saves per thread
action size: actions of a thread per session save

The consistency check has the following performance impact per session save:
iterations/thread size/run size/action size: performance impact
1/5/100/100:   0-16 ms (5 concurrent threads that each do 100 session saves with 100 operations)
1/5/100/1000:  0-63 ms

1/5/10/1000:   0-16 ms
1/5/10/10000 : 0-156 ms
1/5/10/100000: 0-219 ms

I have added a new patch which uses a Java property to enabled to checks (default is no checks). IMHO the performance impact is reasonably small and this combined with a Java property which defaults to false I think this is a good addition.

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>         Attachments: ConcurrencyTest3.java, GXWMF-754-II.patch, JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Stephan Huttenhuis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan Huttenhuis updated JCR-2598:
------------------------------------

    Status: Patch Available  (was: Open)

- Because it is difficult determine all the causes (multiple ItemStateManagers and locking) I propose to do a final consistency check on the ChangeLog in the SharedItemStateManager and to throw an exception if an inconsistency is detected.

- A race condition is exists when moving and deleting nodes with the same name. The index passed to removeChildNode(Name nodeName, int index) may not be valid anymore because another session deleted or moved another child node. Instead of using name + index use id to make sure that the correct node is removed.


See proposed patch (based on the trunk). After the patch the repository is consistent and only a few messages are shown (see Output after patch.txt)


> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.0.0, 1.6.1
>            Reporter: Stephan Huttenhuis
>         Attachments: org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Stephan Huttenhuis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan Huttenhuis updated JCR-2598:
------------------------------------

    Attachment: JCR-2598.patch

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>         Attachments: JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12916804#action_12916804 ] 

Claus Köll commented on JCR-2598:
---------------------------------

Should we add the ConcurrencyTest3 to a TestSuite ?
As i can see the Testcase will not be executed at the Moment...

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>            Assignee: Jukka Zitting
>             Fix For: 1.6.4, 2.0.3, 2.1.1, 2.2.0
>
>         Attachments: ConcurrencyTest3.java, JCR-2598-II.patch, JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12916823#action_12916823 ] 

Claus Köll commented on JCR-2598:
---------------------------------

Merged to the 1.6 branch in revision 1003428.

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>            Assignee: Jukka Zitting
>             Fix For: 1.6.4, 2.0.3, 2.1.1, 2.2.0
>
>         Attachments: ConcurrencyTest3.java, JCR-2598-II.patch, JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12857364#action_12857364 ] 

Jukka Zitting commented on JCR-2598:
------------------------------------

Could you also attach the new ConcurrencyTest3 test case?

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>         Attachments: JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12879341#action_12879341 ] 

Jukka Zitting commented on JCR-2598:
------------------------------------

Patch applied in revision 955229, thanks!

I'm still seeing some exceptions in the test case, so I'm leaving this open until we figure out how to best get rid of them.

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>         Attachments: ConcurrencyTest3.java, JCR-2598-II.patch, JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Stephan Huttenhuis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan Huttenhuis updated JCR-2598:
------------------------------------

    Attachment: JCR-2598-II.patch

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>         Attachments: ConcurrencyTest3.java, JCR-2598-II.patch, JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Stephan Huttenhuis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan Huttenhuis updated JCR-2598:
------------------------------------

    Attachment: ConcurrencyTest3.java

I have attached the unit test.

A Java property could be introduced to enable/disable the checks. This way a  choice can be made between consistency and performance. 

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>         Attachments: ConcurrencyTest3.java, JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Stephan Huttenhuis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan Huttenhuis updated JCR-2598:
------------------------------------

    Attachment: org.apache.jackrabbit.core.ConcurrencyTest3.txt
                Output before patch.txt
                Output after patch.txt

> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>         Attachments: org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2598) Saving concurrent sessions executing random operations causes a corrupt JCR

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855414#action_12855414 ] 

Stefan Guggisberg commented on JCR-2598:
----------------------------------------

thanks fr the patch!

> - Because it is difficult determine all the causes (multiple ItemStateManagers and locking) I propose to do a final consistency check on the ChangeLog in the SharedItemStateManager and to throw an exception if an inconsistency is detected.

what is the performance impact of the proposed change? i am somehow concerned that write performance would suffer significantly.

> - A race condition is exists when moving and deleting nodes with the same name. The index passed to removeChildNode(Name nodeName, int index) may not be valid anymore because another session deleted or moved another child node. Instead of using name + index use id to make sure that the correct node is removed.

looks good


> Saving concurrent sessions executing random operations causes a corrupt JCR
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2598
>                 URL: https://issues.apache.org/jira/browse/JCR-2598
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.1, 2.0.0
>            Reporter: Stephan Huttenhuis
>         Attachments: JCR-2598.patch, org.apache.jackrabbit.core.ConcurrencyTest3.txt, Output after patch.txt, Output before patch.txt
>
>
> Run the attached unit test. Several concurrent sessions add, move, and remove nodes. Then the index is removed and the repository is again started. The repository is in an inconsistent state and the index cannot be rebuild. Also a lot of exceptions occur. See (see Output before patch.txt). Note that the unit test also suffers from the deadlock of issue http://issues.apache.org/jira/browse/JCR-2525 about half the time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.