[SERVER-12602] Shell bulk operations should not accept maxTimeMS parameter Created: 04/Feb/14  Updated: 11/Jul/16  Resolved: 05/Feb/14

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.5.5
Fix Version/s: 2.6.0-rc0

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: pull-request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 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.



 Comments   
Comment by Githook User [ 05/Feb/14 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@10gen.com'}

Message: Shell bulk operations should not accept maxTimeMS parameter, SERVER-12602.

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/3c577a31cbdbb2722ebc2dd71c64e5ed2aab5f0f

Comment by A. Jesse Jiryu Davis [ 04/Feb/14 ]

Updated: the plan now is that bulk operations should not accept maxTimeMS.

Comment by Scott Hernandez (Inactive) [ 04/Feb/14 ]

That doesn't make a lot of sense. I believe that code is wrong and should be removed.

Comment by A. Jesse Jiryu Davis [ 04/Feb/14 ]

Opposite: looks like the bulk code was written to accept the maxTimeMS parameter and pass it to the server, but due to a bug the param is ignored. I'm proposing an update that passes the param to the server.

Comment by Scott Hernandez (Inactive) [ 04/Feb/14 ]

Are you suggesting they should not accept this option? And if not, how can they implement that feature client-side?

Generated at Thu Feb 08 03:29:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.