Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12602

Shell bulk operations should not accept maxTimeMS parameter

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.6.0-rc0
    • 2.5.5
    • Shell
    • Fully Compatible
    • ALL

    Description

      The shell's initializeUnorderedBulkOp and initializeOrderedBulkOp are both written to accept a maxTimeMS parameter, but the parameter is ignored.

      > db.adminCommand({configureFailPoint: 'maxTimeAlwaysTimeOut', mode: 'alwaysOn'})
      { "ok" : 1 }
      > // regular insert fails as expected
      > db.runCommand({insert: 'collection', documents: [{_id: 1}], ordered: false, maxTimeMS: 1})
      { "ok" : 0, "errmsg" : "operation exceeded time limit", "code" : 50 }
      > // batch should fail, too, but succeeds
      > var batch = db.collection.initializeUnorderedBulkOp({maxTimeMS: 1})
      > batch.insert({_id: 2})
      > batch.execute()
      BulkWriteResult({
      	"writeErrors" : [ ],
      	"writeConcernErrors" : [ ],
      	"nInserted" : 1,
      	"nUpserted" : 0,
      	"nUpdated" : 0,
      	"nModified" : 0,
      	"nRemoved" : 0,
      	"upserted" : [ ]
      })

      For now, bulk operations should not accept a maxTimeMS parameter at all.

      Attachments

        Activity

          People

            jesse@mongodb.com A. Jesse Jiryu Davis
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: