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
}
- related to
-
SERVER-11559 Count ops attempted in write commands in mongos and mongod
-
- Closed
-