Jackrabbit Content Repository
  1. Jackrabbit Content Repository
  2. JCR-2913

Shared nodes disappear suddenly - Database corruption : Cannot delete nodes anymore : Node with id 'X" does not have shared parent with id: 'Y'

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      This problem occurs on a following configuration

      • JCR 2.3 Snapshot
      • Tomcat 6
      • Postgresql 9.0

      Jackrabbit is embedded within a Spring application, that communicates with clients in AMF format (Flex client)

      The symptom is that some shared Nodes have disappeared from the repository, without having deleted by our application (and we checked a lot already).
      Then, repository seems to be corrupted, because it becomes impossible to delete any ancestor node of those having disappear.

      The error is not reproducible, it may happen at any time, it is random.
      Sometimes, with a fresh base, after creating some nodes, sometimes it happens after a while, when playing with the application.
      It never happened on Jetty/Derby development server, but always happened on servers with Postgres, even with a single user.

      I guess it is not a bug in JCR, but that we provoked the problem in some way. Maybe by multi-threading ?
      However, for each remote call that send data to write, we create a new JCRSession, then save it multiple times, then close it.

        Activity

        julien revel created issue -
        julien revel made changes -
        Field Original Value New Value
        Summary Shared nodes disappear suddenly - Database corruption : Cannot delete nodes anymore : Error is Node with id 'X" does not have shared parent with id: 'Y' Shared nodes disappear suddenly - Database corruption : Cannot delete nodes anymore : Node with id 'X" does not have shared parent with id: 'Y'
        Hide
        Woonsan Ko added a comment -

        I happened to see the same error message while deleting a node as well.
        So, I looked into the code from there throwing this exception message: ItemManager.java and NodeState.java.

        I don't have a whole picture with those, but there might be a thread safety issue in NodeState.java where 'sharedSet' private member must be used in synchronized way. All related operations of NodeSet class are marked as synchronized when using 'sharedSet' member except of NodeSet#getSharedSet() method.

        And NodeSet#getSharedSet() seems to have been used in many locations. e.g, HierarchyManagerImpl#getParentIds(), ItemSaveOperation#perform(SessionContext), NodeImpl#getSharedSet(), NodeIndexer#createDoc(), SharedItemStateManager#checkParent(), etc.

        Doesn't NodeSet#getSharedSet() need to be marked as synchronized as well to avoid this kind of issue?

        Show
        Woonsan Ko added a comment - I happened to see the same error message while deleting a node as well. So, I looked into the code from there throwing this exception message: ItemManager.java and NodeState.java. I don't have a whole picture with those, but there might be a thread safety issue in NodeState.java where 'sharedSet' private member must be used in synchronized way. All related operations of NodeSet class are marked as synchronized when using 'sharedSet' member except of NodeSet#getSharedSet() method. And NodeSet#getSharedSet() seems to have been used in many locations. e.g, HierarchyManagerImpl#getParentIds(), ItemSaveOperation#perform(SessionContext), NodeImpl#getSharedSet(), NodeIndexer#createDoc(), SharedItemStateManager#checkParent(), etc. Doesn't NodeSet#getSharedSet() need to be marked as synchronized as well to avoid this kind of issue?

          People

          • Assignee:
            Unassigned
            Reporter:
            julien revel
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development