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 16:16:00 UTC

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

    [ https://issues.apache.org/jira/browse/OAK-9253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17213197#comment-17213197 ] 

Hans-Peter Stoerr edited comment on OAK-9253 at 10/13/20, 4:15 PM:
-------------------------------------------------------------------

Thank you for your prompt response! My session is an admin session that has all permissions to both paths. I'm not quite sure what that move method is, but there is actually one important difference: after the move operation I did a session.save() before the getNodeByIdentifier is called. This seems to be important - if I leave that out, the problem doesn't happen.

If this fails to reproduce the bug: did you run it on those exact versions of OAK and Jackrabbit which are embedded in the Apache Sling Starter, too? Perhaps that problem has been fixed in the meantime. Also it was a little unpredictable and was sometimes working, sometimes not. So it might be a good idea to run that in a loop.


was (Author: hanspeterstoerr):
Thank you! My session is an admin session that has all permissions to both paths. I'm not quite sure what that move method is, but there is actually one important difference: after the move operation I did a session.save() before the getNodeByIdentifier is called. This seems to be important - if I leave that out, the problem doesn't happen.

If this fails to reproduce the bug: did you run it on those exact versions of OAK and Jackrabbit which are embedded in the Apache Sling Starter, too? Perhaps that problem has been fixed in the meantime. Also it was a little unpredictable and was sometimes working, sometimes not. So it might be a good idea to run that in a loop.

> getNodeByIdentifier doesn't find moved node
> -------------------------------------------
>
>                 Key: OAK-9253
>                 URL: https://issues.apache.org/jira/browse/OAK-9253
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: jcr
>    Affects Versions: 1.32.0
>         Environment: OAK 1.32.0 , Jackrabbit 2.20.0 with tarfile persistence with in Apache Sling, JDK 13.0.2 on MacOS
>            Reporter: Hans-Peter Stoerr
>            Priority: Major
>
> 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.
> 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.



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