opcounters after write commands in mongos not correctly updated

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.6.0-rc0
    • Affects Version/s: None
    • Component/s: Write Ops
    • None
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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
      }
      

            Assignee:
            Siyuan Zhou
            Reporter:
            Greg Studer (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: