Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-4920

DefaultSyncHandler.listIdentities() search too broad, triggers traversal warning

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4.8, 1.5.11
    • 1.7.0, 1.8.0
    • auth-external

    Description

      DefaultSyncHandler.listIdentities() collects users by searching for all nodes under /home – the xpath query executed is

      /jcr:root/home//element(*)[@jcr:primaryType]
      

      With a few hundred users this easily gives an oak index traversal warning:

      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
      

      A few lines later it actually reduces 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:

      userManager.findAuthorizables("rep:externalId", null);
      

      Attachments

        1. listIdentities_simpleExtIdQuery_withCurrentPath.txt
          117 kB
          Angela Schreiber
        2. listIdentities_simpleExtIdQuery_withoutCurrentPath.txt
          124 kB
          Angela Schreiber
        3. listIdentities_statusquo.txt
          126 kB
          Angela Schreiber
        4. listIdentities_userExtIdQuery.txt
          120 kB
          Angela Schreiber

        Issue Links

          Activity

            People

              angela Angela Schreiber
              alexander.klimetschek Alexander Klimetschek
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: