Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-577

Incorrect usage of WriteResult#getError/getLastError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.6
    • mongomk
    • None

    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

      Attachments

        Activity

          People

            Unassigned Unassigned
            meteatamel Mete Atamel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: