-
Type: Bug
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Component/s: Collections
-
Tags:
-
Sprint:nxplatform next
-
Story Points:5
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:?]