[SERVER-12549] opcounters after write commands in mongos not correctly updated Created: 30/Jan/14  Updated: 11/Jul/16  Resolved: 11/Feb/14

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: 2.6.0-rc0

Type: Bug Priority: Major - P3
Reporter: Greg Studer Assignee: Siyuan Zhou
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-11559 Count ops attempted in write commands... Closed
Operating System: ALL
Participants:

 Description   

When using write commands through mongos, opCounters are not correctly updated - currently (insert) opCounters are updated on the legacy write path only.

We should update opCounters in the cluster_write_cmd.cpp itself.

mongos> db.serverStatus().opcounters
{
   "insert" : 0,
   "query" : 9,
   "update" : 0,
   "delete" : 0,
   "getmore" : 0,
   "command" : 20
}
mongos> db.foo.insert({})
SingleWriteResult({
   "writeErrors" : [ ],
   "writeConcernErrors" : [ ],
   "nInserted" : 1,
   "nUpserted" : 0,
   "nUpdated" : 0,
   "nModified" : 0,
   "nRemoved" : 0,
   "upserted" : [ ]
})
mongos> db.serverStatus().opcounters
{
   "insert" : 0,
   "query" : 9,
   "update" : 0,
   "delete" : 0,
   "getmore" : 0,
   "command" : 25
}



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

Author:

{u'username': u'gregstuder', u'name': u'Greg Studer', u'email': u'greg@10gen.com'}

Message: SERVER-12549 combined write op errors need an index
Branch: master
https://github.com/mongodb/mongo/commit/065d65bd64a4b5f9541a24fe491a1d27d56890ad

Comment by Githook User [ 10/Feb/14 ]

Author:

{u'username': u'visualzhou', u'name': u'Siyuan Zhou', u'email': u'siyuan.zhou@mongodb.com'}

Message: SERVER-12549 opcounters after write commands in mongos not correctly updated

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

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