Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-30243

Add index on collection:documentIds to optimize RemovedCollectionWork

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.10, 11.4, 2021.1
    • Fix Version/s: 10.10-HF49, 11.x, 2021.5
    • Component/s: Core

      Description

      RemovedCollectionWork and RemovedCollectionMemberWork may run into query times out because of a missing index on collection:documentIds.

       

      For instance:

      com.mongodb.MongoSocketReadTimeoutException: Timeout while receiving message
      	at com.mongodb.internal.connection.InternalStreamConnection.translateReadException(InternalStreamConnection.java:563) ~[mongo-java-driver-3.12.1.jar:?]
      ...	at org.nuxeo.ecm.core.storage.mongodb.MongoDBRepository.queryAndFetch(MongoDBRepository.java:843) ~[nuxeo-core-storage-mongodb-10.10-HF40.jar:?]
      	at org.nuxeo.ecm.core.storage.dbs.DBSCachingRepository.queryAndFetch(DBSCachingRepository.java:381) ~[nuxeo-core-storage-dbs-10.10-HF39.jar:?]
      	at org.nuxeo.ecm.core.storage.dbs.DBSSession.doQueryAndFetch(DBSSession.java:1618) ~[nuxeo-core-storage-dbs-10.10-HF39.jar:?]
      	at org.nuxeo.ecm.core.storage.dbs.DBSSession.doQuery(DBSSession.java:1510) ~[nuxeo-core-storage-dbs-10.10-HF39.jar:?]
      	at org.nuxeo.ecm.core.storage.dbs.DBSSession.query(DBSSession.java:1498) ~[nuxeo-core-storage-dbs-10.10-HF39.jar:?]
      	at org.nuxeo.ecm.core.storage.dbs.DBSSession.query(DBSSession.java:167) ~[nuxeo-core-storage-dbs-10.10-HF39.jar:?]
      	at sun.reflect.GeneratedMethodAccessor184.invoke(Unknown Source) ~[?:?]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_282]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_282]
      	at org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase$DBSSessionInvoker.invoke(DBSRepositoryBase.java:505) ~[nuxeo-core-storage-dbs-10.10-HF39.jar:?]
      	at com.sun.proxy.$Proxy102.query(Unknown Source) ~[?:?]
      	at org.nuxeo.ecm.core.api.AbstractSession.query(AbstractSession.java:1196) ~[nuxeo-core-10.10-HF36.jar:?]
      	at org.nuxeo.ecm.core.api.AbstractSession.query(AbstractSession.java:1173) ~[nuxeo-core-10.10-HF36.jar:?]
      	at org.nuxeo.ecm.collections.core.worker.RemovedAbstractWork.getNextResults(RemovedAbstractWork.java:101) ~[nuxeo-platform-collections-core-10.10-HF35.jar:?]
      	at org.nuxeo.ecm.collections.core.worker.RemovedAbstractWork.work(RemovedAbstractWork.java:66) ~[nuxeo-platform-collections-core-10.10-HF35.jar:?]
      ...
       

       

      The query on Mongo side is:

       {"find": "default", "filter": {"$and": [{"collection:documentIds": "?"}, {"ecm:primaryType": {"$in": ["?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?"]}}]}, "projection": {"ecm:id": "?", "ecm:parentId": "?", "ecm:name": "?"}, "limit": "?", "maxTimeMS": "?", "$db": "?", "$clusterTime": {"clusterTime": "?", "signature": {"hash": "?", "keyId": "?"}}, "lsid": {"id": "?"}}

      without the collection:documentIds index this run into timeout.

      Index should also be added to VCS repositories.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: