Details
-
Bug
-
Resolution: Done
-
Major - P3
-
2.5.5
-
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.