Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-44332

benchRun passes empty writeConcern

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 4.2.1
    • Component/s: None
    • Server Tooling & Methods
    • ALL

      benchRun always sends a writeConcern field, which is an empty object if no WC has been specified. Better would be to omit the field entirely in this case.

      > db.test.drop()
      true
      > db.test.insert({_id:0})
      WriteResult({ "nInserted" : 1 })
      > benchRun({ "ops" : [ { "op" : "update", "ns" : "test.test", "query" : { "_id" : 0 }, "writeCmd" : true, "update" : { "$inc" : { "x" : 1 } } } ], "seconds" : 0.1, host: db.getMongo().host })
      {
              "note" : "values per second",
              "errCount" : NumberLong(0),
              "trapped" : "error: not implemented",
              "updateLatencyAverageMicros" : 195.5078431372549,
              "totalOps" : NumberLong(510),
              "totalOps/s" : 5087.992338082126,
              "findOne" : 0,
              "insert" : 0,
              "delete" : 0,
              "update" : 5087.992338082126,
              "query" : 0,
              "command" : 0
      }
      > db.test.find({_id:0})
      { "_id" : 0, "x" : 510 }
      >
      
      2019-10-31T14:54:37.289+1100 D2 COMMAND  [conn19] run command test.$cmd { update: "test", writeConcern: {}, $db: "test" }
      2019-10-31T14:54:37.289+1100 D2 QUERY    [conn19] Using idhack: { _id: 0.0 }
      2019-10-31T14:54:37.290+1100 I  WRITE    [conn19] update test.test appName: "BenchRun" command: { q: { _id: 0.0 }, u: { $inc: { x: 1.0 } }, multi: false, upsert: false } planSummary: IDHACK keysExamined:1 docsExamined:1 nMatched:1 nModified:1 numYields:0 locks:{ ParallelBatchWriterMode: { acquireCount: { r: 1 } }, ReplicationStateTransition: { acquireCount: { w: 1 } }, Global: { acquireCount: { w: 1 } }, Database: { acquireCount: { w: 1 } }, Collection: { acquireCount: { w: 1 } }, Mutex: { acquireCount: { r: 2 } } } flowControl:{ acquireCount: 1 } storage:{} 0ms
      2019-10-31T14:54:37.290+1100 D2 REPL     [conn19] Waiting for write concern. OpTime: { ts: Timestamp(0, 0), t: -1 }, write concern: { w: 1, wtimeout: 0 }
      2019-10-31T14:54:37.290+1100 I  COMMAND  [conn19] command test.$cmd appName: "BenchRun" command: update { update: "test", writeConcern: {}, $db: "test" } numYields:0 reslen:60 locks:{ ParallelBatchWriterMode: { acquireCount: { r: 2 } }, ReplicationStateTransition: { acquireCount: { w: 2 } }, Global: { acquireCount: { r: 1, w: 1 } }, Database: { acquireCount: { w: 1 } }, Collection: { acquireCount: { w: 1 } }, Mutex: { acquireCount: { r: 2 } } } flowControl:{ acquireCount: 1 } storage:{} protocol:op_msg 0ms
      

            Assignee:
            backlog-server-stm Backlog - Server Tooling and Methods (STM) (Inactive)
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: