Description
When running MongoMKBranchMergeTest#concurrentNonConflictingMerges with high number of threads (>20), I sometimes see the following Mongo exception:
Caused by: java.lang.IllegalStateException: The connection may have been used since this write, cannot obtain a result
at com.mongodb.WriteResult.getLastError(WriteResult.java:100)
at com.mongodb.WriteResult.getLastError(WriteResult.java:73)
at com.mongodb.WriteResult.getField(WriteResult.java:141)
at com.mongodb.WriteResult.getError(WriteResult.java:118)
at org.apache.jackrabbit.mongomk.impl.command.CommitCommandNew.markAsFailed(CommitCommandNew.java:364)
at
According to this link [0], this is due to updating a collection without WriteConcern.SAFE and then calling WriteResult#getLastError. That's exactly what we do with commit collection. We need to change MongoMK code to update commit collection with WriteConcern.SAFE.
[0] https://groups.google.com/d/topic/mongodb-user/xzw0Cb831VY/discussion