Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9253

getNodeByIdentifier doesn't find moved node

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.32.0
    • Fix Version/s: None
    • Component/s: jcr
    • Labels:
      None
    • Environment:

      OAK 1.32.0 , Jackrabbit 2.20.0 with tarfile persistence with in Apache Sling, JDK 13.0.2 on MacOS

      Description

      When I move a mix:referenceable node, it sometimes happens that the moved node is not found with session.getNodeByIdentifier anymore - it throws an ItemNotFoundException, and a query /jcr:root//*[@jcr:uuid='${uuid}'] also does not find the node. This is not completely deterministic - sometimes works correctly, but in my environment it fails more often than not.

      I tested it with the following code (Node and Session being from javax.jcr.*):

          Node parent = session.getNode(PATH);
          String name = "child" + System.currentTimeMillis();
          Node child = parent.addNode(name, "sling:Folder");
          child.addMixin("mix:referenceable");
          session.save();
          String id = child.getIdentifier();
          // session.getNodeByIdentifier(id); // OK, works as expected here.
          session.move(child.getPath(), PATH2 + "/" + name);
          session.save();
          session.getNodeByIdentifier(id); // often throws ItemNotFoundException!
      

      PATH and PATH2 denote two preexisting writeable nodes.

      I discovered the problem using the (almost) latest version of Sling Starter which uses OAK version 1.32.0 and Jackrabbit version 2.20.0 with tarfile persistence. (I'm not sure whether this is an OAK or Jackrabbit bug - please forgive me if it's the wrong project). With the previously released version 11 of Sling Starter, using OAK version 1.8.8 and Jackrabbit version 2.16.3 there were no such problems.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                hanspeterstoerr Hans-Peter Stoerr
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: