[SERVER-3817] Increment opcounters for bulk insert Created: 12/Sep/11  Updated: 11/Jul/16  Resolved: 12/Sep/11

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.0.0
Fix Version/s: 2.0.3, 2.1.0

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

Currently we only increment opcounters for bulk insert if one of the inserts fails

In [8]: db.command('serverStatus')['opcounters']['insert']
Out[8]: 0

In [9]: db.foo.insert([{}])
Out[9]: [ObjectId('4e6e698f7b98300f2b000003')]

In [10]: db.command('serverStatus')['opcounters']['insert']
Out[10]: 1

In [11]: db.foo.insert([{},{}])
Out[11]: [ObjectId('4e6e699f7b98300f2b000004'), ObjectId('4e6e699f7b98300f2b000005')]

In [12]: db.command('serverStatus')['opcounters']['insert']
Out[12]: 1

In [14]: db.foo.insert([

{'_id':1}

,

{'_id':1}

,

{'_id':1}

])
Out[14]: [1, 1, 1]

In [15]: db.command('serverStatus')['opcounters']['insert']
Out[15]: 2



 Comments   
Comment by auto [ 20/Feb/12 ]

Author:

{u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: Correctly count bulk inserts in opcounters SERVER-3817
Branch: v2.0
https://github.com/mongodb/mongo/commit/3fc4863624c286a12d9c6b85dfd485f7cb87bb95

Comment by auto [ 12/Sep/11 ]

Author:

{u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: Correctly count bulk inserts in opcounters SERVER-3817
Branch: master
https://github.com/mongodb/mongo/commit/43cff65e665dcc6ffd866f324fb917e75ba31085

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