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 "Julian Reschke (Jira)" <ji...@apache.org> on 2019/09/17 12:49:00 UTC
[jira] [Comment Edited] (OAK-8628) NodeStateUtils.isHidden expects
names but get's called with paths
[ https://issues.apache.org/jira/browse/OAK-8628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16931362#comment-16931362 ]
Julian Reschke edited comment on OAK-8628 at 9/17/19 12:48 PM:
---------------------------------------------------------------
Looking some more I see in `Cursors`:
{noformat}
ChildNodeEntry entry = iterator.next();
readCount++;
if (readCount % 1000 == 0) {
FilterIterators.checkReadLimit(readCount, settings);
LOG.warn("Traversed " + readCount + " nodes with filter " + filter + "; consider creating an index or changing the query");
}
NodeState node = entry.getNodeState();
String name = entry.getName();
if (NodeStateUtils.isHidden(name)) {
continue;
}
currentPath = PathUtils.concat(parentPath, name);
{noformat}
So what get's tested for "hidden" is the return value of `ChildNodeEnty.getName()`. How can that be a full path???
The reason seems to be in the same class, `TraversingCursor`, which costructs the entries with a path instead of a name.
So maybe `MemoryChildNodeEntry` should enforce the contract in the constructor???
was (Author: reschke):
Looking some more I see in `Cursors`:
{noformat}
ChildNodeEntry entry = iterator.next();
readCount++;
if (readCount % 1000 == 0) {
FilterIterators.checkReadLimit(readCount, settings);
LOG.warn("Traversed " + readCount + " nodes with filter " + filter + "; consider creating an index or changing the query");
}
NodeState node = entry.getNodeState();
String name = entry.getName();
if (NodeStateUtils.isHidden(name)) {
continue;
}
currentPath = PathUtils.concat(parentPath, name);
{noformat}
So what get's tested for "hidden" is the return value of `ChildNodeEnty.getName()`. How can that be a full path???
> NodeStateUtils.isHidden expects names but get's called with paths
> -----------------------------------------------------------------
>
> Key: OAK-8628
> URL: https://issues.apache.org/jira/browse/OAK-8628
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: store-spi
> Reporter: Julian Reschke
> Priority: Major
>
> For instance with "/test" from
> {noformat}
> 10:30:12.983 ERROR [main] NodeStateUtils.java:50 /test
> java.lang.Exception: call stack
> at org.apache.jackrabbit.oak.spi.state.NodeStateUtils.isHidden(NodeStateUtils.java:50)
> at org.apache.jackrabbit.oak.plugins.index.Cursors$TraversingCursor.fetchNext(Cursors.java:348)
> at org.apache.jackrabbit.oak.plugins.index.Cursors$TraversingCursor.hasNext(Cursors.java:327)
> at org.apache.jackrabbit.oak.query.ast.SelectorImpl.nextInternal(SelectorImpl.java:515)
> at org.apache.jackrabbit.oak.query.ast.SelectorImpl.next(SelectorImpl.java:508)
> {noformat}
> We should either change doc and impl to handle paths, or enforce the contract and chagne other code to use `isHiddenPath()` instead.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)