Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9826

jcr:uuid index not updated on move

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Starter 12
    • Fix Version/s: JCR Oak Server 1.2.10
    • Component/s: JCR, Starter
    • Labels:
      None
    • Environment:
      Sling-Starter 12-SNAPSHOT (commit addb8f7b) with JDK 11 and 13 on MacOS, JDK 11 on an x86_64 Linux

      Description

      When changing from Sling Starter 11 to the (almost) latest version of Sling Starter 12-SNAPSHOT I get the problem that it is not possible to find nodes that are mix:referenceable by their jcr:uuid after they have been moved in the JCR tree: Session.getNodeByIdentifier throws an ItemNotFoundException, and a query /jcr:root//*[@jcr:uuid='${uuid}'] does not find the node.

      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. If I force a refresh of the /oak:index/uuid, the node is found again - until it is moved again. The query problem is also easy to replicate by creating a mix:referenceable node in the browser, moving it and trying to query it with /jcr:root//*[@jcr:uuid='${uuid}'] .

      I initially reported the bug to the Jackrabbit OAK project, but it is not possible to reproduce this with the oak-jcr tests. I could also not reproduce it with a unit test in org-apache-sling-jcr-resource, only when using the Sling Starter 12. This comment on my Oak bugreport suggests that there might be some misconfiguration in Sling.

      Thank you very much!

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              enorman Eric Norman
              Reporter:
              hanspeterstoerr Hans-Peter Stoerr

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment