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

The number of documents in a Collection should be caped

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 2021.x, 2023.x, 2025.x
    • Component/s: Collections

      Description

      Today we can add an infinite number of documents to a collection.

      Not to mention performance issue, there are limits at the backend level and the number of documents must be caped.

      A default limit should be set to let say 10k and must be configurable from the nuxeo.conf file.

      For instance, the maximum document size for MongoDB is 16mb and after inserting 334k documents in the collection we will encounter:

      com.mongodb.MongoWriteException: Write operation error on server mongourl:27017. Write error: WriteError{code=17419, message='Resulting document after update is larger than 16777216', details={}}.
      	at com.mongodb.client.internal.MongoCollectionImpl.executeSingleWriteRequest(MongoCollectionImpl.java:1033) ~[mongodb-driver-sync-4.7.2.jar:?]
      	at com.mongodb.client.internal.MongoCollectionImpl.executeUpdate(MongoCollectionImpl.java:1009) ~[mongodb-driver-sync-4.7.2.jar:?]
      	at com.mongodb.client.internal.MongoCollectionImpl.updateMany(MongoCollectionImpl.java:630) ~[mongodb-driver-sync-4.7.2.jar:?]
      	at com.mongodb.client.internal.MongoCollectionImpl.updateMany(MongoCollectionImpl.java:625) ~[mongodb-driver-sync-4.7.2.jar:?]
      	at org.nuxeo.ecm.core.storage.mongodb.MongoDBConnection.updateMany(MongoDBConnection.java:1062) ~[nuxeo-core-storage-mongodb-2021.57.3.jar:?]
      	at org.nuxeo.ecm.core.storage.mongodb.MongoDBConnection.updateState(MongoDBConnection.java:534) ~[nuxeo-core-storage-mongodb-2021.57.3.jar:?]
      	at org.nuxeo.ecm.core.storage.dbs.DBSCachingConnection.updateState(DBSCachingConnection.java:198) ~[nuxeo-core-storage-dbs-2021.57.3.jar:?]
      	at org.nuxeo.ecm.core.storage.dbs.DBSTransactionState.save(DBSTransactionState.java:982) ~[nuxeo-core-storage-dbs-2021.57.3.jar:?]
      	at org.nuxeo.ecm.core.storage.dbs.DBSSession.save(DBSSession.java:238) ~[nuxeo-core-storage-dbs-2021.57.3.jar:?]
      	at org.nuxeo.ecm.core.api.AbstractSession.save(AbstractSession.java:1697) ~[nuxeo-core-2021.57.3.jar:?]
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: