Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9044

Use traversal to count items in resource based distribution queue

    XMLWordPrintableJSON

    Details

      Description

      ResourceQueueUtils# getResourceCount() function is responsible for triggering an xpath query to get the resource queue items. This query tries to find all the nt:unstructured nodes under a resource queue's path. This query is currently not backed by any index definition. This leads to a warning like below being logged when a request is made to list the items of resource queue -

      11.12.2019 14:15:46.926 *WARN* [0:0:0:0:0:0:0:1 [1576053946802] GET /libs/granite/distribution/content/distribution-agent.html HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl Traversal query (query without index): select [jcr:path], [jcr:score], * from [nt:unstructured] as a where isdescendantnode(a, '/var/sling/distribution/queues/bpqatest0/error-endpoint-bpqatest0') /* xpath: /jcr:root/var/sling/distribution/queues/bpqatest0/error-endpoint-bpqatest0//element(*,nt:unstructured) */; consider creating an index
      

      Switching to traversal here would be as efficient as writing an index for this query.

      Further, since a resource queue can also be an active queue and the items will come and go, the indexer will have to do extra work of indexing the transient items.

      cc - Timothee Maret, Ashish Chopra

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                marett Timothee Maret
                Reporter:
                mohiaror Mohit Arora
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m