Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-20775

rest api /deleted-nodes with maxitems parameter take longer when there are more items in the trash can

    Details

    • Type: Service Pack Request
    • Status: In Progress
    • Resolution: Unresolved
    • Affects Version/s: 5.2.5
    • Fix Version/s: 5.2.N, 6.2.N
    • Component/s: ACS REST API
    • Labels:
    • Bug Priority:
      Category 3
    • Escalated By:
      CSO
    • ACT Numbers:

      00992304, 01003892

    • Premier Customer:
      Yes
    • Delivery Team:
      Customer Excellence

      Description

      Description

      With the maxitems parameter specified, the time taken to retrieve result from a Rest API call to the trash grows with number of items in trash can. It appears all nodes in the trash can are queried and then the results truncated to the value maxitems afterwards.

      This is particularly an issue where the user is an administrator as deleted nodes for all users are collected, which has the potential to be a large number, and then only the value of maxitems is filtered and returned.

      The rest api used is:

      https://api-explorer.alfresco.com/api-explorer/#!/trashcan/listDeletedNodes

      Supporting evidence

      Steps to reproduce:

      Before importing documents as per the below steps, make sure to disable JOD Converter and ooo from alfresco-global.properties to speed up any imports. This is not a required step but it does quicken this import process.

      The number of nodes in the trash can is large to highlight the time taken. This can also be observed with a lower number of nodes in the trash can.

      There are two script used in the below steps to reproduce, these are given as an example and other methods to create, import and delete files can also be used. This does not affect the reproduction of this issue.

      1. Install ACS 5.2.5
      2. Create a test site named 'deletionTestSite'
      3. Create 100 files on the ACS installs local file system, this can be done using the attached bash script generater.sh. Please make sure to adjust the scripts NUM_OF_FILES variable to create only 100 files, this is described in the script file itself. It is best to create this locally on the ACS server as this will speed up imports
      4. Import the files using bulk fs in-place tool, this is documented here: https://docs.alfresco.com/5.2/concepts/bulk-import-in-place.html
      5. Delete the nodes using the attached javascript file deleteFiles.js which will iteratively delete 5000 files as a maximum on each run. 
      6. Query the trash can using /delete-node end point, for example: http://localhost:8080//alfresco/api/-default-/public/alfresco/versions/1/deleted-nodes?*maxItems=25*
      7. Take a note of the execution time
      8. Create a larger number of files on the local file system, again using generator.sh and adjusting the scripts NUM_OF_FILES variable. The initial number of files generated for this Jira was 37000.
      9. Import the files using bulk fs in-place tool, this is documented here: https://docs.alfresco.com/5.2/concepts/bulk-import-in-place.html
      10. Delete all of the imported files using deleteFiles.js, Run the script multiple times to delete all nodes as only 5000 are deleted in a single run.
      11. Query the trash can using /delete-node end point, for example: http://localhost:8080//alfresco/api/-default-/public/alfresco/versions/1/deleted-nodes?maxItems=25
      12. Take a note of the execution time.

      Expected Behaviour

      In asymptotic terms, when the /deleted-nodes end point is used with the maxitems parameter, the time taken to to return results should not scale with the number of items in the trash can. It would be expected that the time taken should be near to constant.

      Observed Behaviour

      The time taken to return 25 items from step 6 above, where the trash can only contained 100 items, is significantly less then the time taken to query 25 items in step 11, where the trash can contained 37000 items.

        Attachments

        1. deleteFiles.js
          0.3 kB
        2. generator.sh
          0.3 kB

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  aepure Alexandru Epure
                  Reporter:
                  sreehall Sandeep Reehall
                • Votes:
                  2 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:

                    Structure Helper Panel