You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Hans-Peter Stoerr (Jira)" <ji...@apache.org> on 2020/10/13 12:57:00 UTC

[jira] [Created] (OAK-9253) getNodeByIdentifier doesn't find moved node

Hans-Peter Stoerr created OAK-9253:
--------------------------------------

             Summary: getNodeByIdentifier doesn't find moved node
                 Key: OAK-9253
                 URL: https://issues.apache.org/jira/browse/OAK-9253
             Project: Jackrabbit Oak
          Issue Type: Bug
    Affects Versions: 1.32.0
         Environment: I discovered the problem using the (almost) latest version of [Sling Starter|https://github.com/apache/sling-org-apache-sling-starter/commit/addb8f7ba16dfb2ab6cda1a70f98a461a7cacb7a] 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.
            Reporter: Hans-Peter Stoerr


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.*):
{code:java}
    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!
{code}

PATH and PATH2 denote two preexisting writeable nodes.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)