jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "angela (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (OAK-4920) DefaultSyncHandler.listIdentities() search too broad, triggers traversal warning
Date Mon, 06 Mar 2017 12:50:32 GMT

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

angela edited comment on OAK-4920 at 3/6/17 12:49 PM:
------------------------------------------------------

ListIdentitiesTest benchmark results for the following queries:

h6. status quo
{code}
userManager.findAuthorizables("jcr:primaryType", null);
{code}
=> traversal warning

h6. simple-extidquery-without-currentpath-element
{code}
userManager.findAuthorizables(DefaultSyncContext.REP_EXTERNAL_ID, null);
{code}
=> no traversal warning

h6. simple-extidquery-with-currentpath-element
{code}
userManager.findAuthorizables("./"+DefaultSyncContext.REP_EXTERNAL_ID, null);
{code}
=> gives traversal warning in combination with OAK-5892 (see there for additional results)

h6. search with explicit user-query object
{code}
userManager.findAuthorizables(new Query() {
       public <T> void build(QueryBuilder<T> builder) {
              builder.setCondition(builder.exists('@' + ExternalIdentityConstants.REP_EXTERNAL_ID));
        }
});
{code}
=> traversal warning


was (Author: anchela):
ListIdentitiesTest benchmark results for the following queries:

h6. status quo
{code}
userManager.findAuthorizables("jcr:primaryType", null);
{code}

h6. simple-extidquery-without-currentpath-element
{code}
userManager.findAuthorizables(DefaultSyncContext.REP_EXTERNAL_ID, null);
{code}

h6. simple-extidquery-with-currentpath-element
{code}
userManager.findAuthorizables("./"+DefaultSyncContext.REP_EXTERNAL_ID, null);
{code}

h6. search with explicit user-query object
{code}
userManager.findAuthorizables(new Query() {
       public <T> void build(QueryBuilder<T> builder) {
              builder.setCondition(builder.exists('@' + ExternalIdentityConstants.REP_EXTERNAL_ID));
        }
});
{code}

> DefaultSyncHandler.listIdentities() search too broad, triggers traversal warning
> --------------------------------------------------------------------------------
>
>                 Key: OAK-4920
>                 URL: https://issues.apache.org/jira/browse/OAK-4920
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: auth-external
>    Affects Versions: 1.4.8, 1.5.11
>            Reporter: Alexander Klimetschek
>            Assignee: angela
>              Labels: performance
>             Fix For: 1.8
>
>         Attachments: listIdentities_simpleExtIdQuery_withCurrentPath.txt, listIdentities_simpleExtIdQuery_withoutCurrentPath.txt,
listIdentities_statusquo.txt, listIdentities_userExtIdQuery.txt
>
>
> DefaultSyncHandler.listIdentities() collects users by [searching for all nodes under
/home|https://github.com/apache/jackrabbit-oak/blob/b3e62e3467bf6433b5a419c2f371331f33e57820/oak-auth-external/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/DefaultSyncHandler.java#L143]
– the xpath query executed is
> {noformat}
> /jcr:root/home//element(*)[@jcr:primaryType]
> {noformat}
> With a few hundred users this easily gives an oak index traversal warning:
> {noformat}
> org.apache.jackrabbit.oak.spi.query.Cursors$TraversingCursor Traversed 1000 nodes with
filter Filter(query=select [jcr:path], [jcr:score], * from [nt:base] as a where [jcr:primaryType]
is not null and isdescendantnode(a, '/home') /* xpath: /jcr:root/home//element(*)[@jcr:primaryType]
*/, path=/home//*, property=[jcr:primaryType=[is not null]]); consider creating an index or
changing the query
> {noformat}
> A few lines later [it actually reduces|https://github.com/apache/jackrabbit-oak/blob/b3e62e3467bf6433b5a419c2f371331f33e57820/oak-auth-external/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/DefaultSyncHandler.java#L151]
the result to authorizables which have a {{rep:externalId}}. Since OAK-4301 there is an oak
index for {{rep:externalId}}, so the query can be optimized by searching for anything with
{{rep:externalId}} instead:
> {code:java}
> userManager.findAuthorizables("rep:externalId", null);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message