rishabhdaim commented on code in PR #863:
URL: https://github.com/apache/jackrabbit-oak/pull/863#discussion_r1138137255


##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java:
##########
@@ -1078,23 +1090,25 @@ private <T extends Document> T 
findAndModify(Collection<T> collection,
                 }
             }
 
-            int size = updateOp.toString().length();
-            if(size > SIZE_LIMIT) {
-                LOG.warn("Document with ID={} has size={} that exceeds 16MB 
size limit", updateOp.getId(), size);
-            }
             // conditional update failed or not possible
             // perform operation and get complete document
             Bson query = createQueryForUpdate(updateOp.getId(), 
updateOp.getConditions());
             FindOneAndUpdateOptions options = new FindOneAndUpdateOptions()
                     .returnDocument(ReturnDocument.BEFORE).upsert(upsert);
-            BasicDBObject oldNode = execute(session -> {
-                if (session != null) {
-                    return dbCollection.findOneAndUpdate(session, query, 
update, options);
-                } else {
-                    return dbCollection.findOneAndUpdate(query, update, 
options);
-                }
-            }, collection);
-
+            BasicDBObject oldNode = null;
+            try {
+                oldNode = execute(session -> {
+                    if (session != null) {
+                        return dbCollection.findOneAndUpdate(session, query, 
update, options);
+                    } else {
+                        return dbCollection.findOneAndUpdate(query, update, 
options);
+                    }
+                }, collection);
+            } catch (MongoWriteException e) {
+                WriteError error = e.getError();
+                LOG.warn(e.getMessage(), updateOp.getId(), 
updateOp.getConditions(), oldNode.size());

Review Comment:
   Same as the previous comment. It would only print `e.getMessage()` and 
ignore the other values.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to