[SERVER-44332] benchRun passes empty writeConcern Created: 31/Oct/19  Updated: 06/Dec/22  Resolved: 15/Jun/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.2.1
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Kevin Pulo Assignee: Backlog - Server Tooling and Methods (STM) (Inactive)
Resolution: Won't Fix Votes: 0
Labels: tig-benchrun
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Server Tooling & Methods
Operating System: ALL
Participants:

 Description   

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


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