Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-710

Wrong writeConcernErrors format

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2-rc0
    • Affects Version/s: None
    • Component/s: Bulk API, libmongoc
    • None

      I think the driver is just appending write concern errors from bulk ops to the same subdocument instead of appending subdocuments to an array of writeConcern errors:

      { "nInserted" : 3,
      "nMatched" : 0,
      "nModified" : 0,
      "nRemoved" : 0,
      "nUpserted" : 2,
      "upserted" : [ { "index" : 2,
      "_id" : { "$oid" : "55823de64c976b58533705d7" } }, { "index" : 3,
      "_id" : { "$oid" : "55823de64c976b58533705d8" } } ],
      "writeErrors" : [  ],
      "writeConcernError" : { "code" : 64,
      "errInfo" : { "wtimeout" : true },
      "errmsg" : "waiting for replication timed out",
      "code" : 64,
      "errInfo" : { "wtimeout" : true },
      "errmsg" : "waiting for replication timed out",
      "code" : 64,
      "errInfo" : { "wtimeout" : true },
      "errmsg" : "waiting for replication timed out" } }
      

      Besides, the field should be "writeConcernErrors" plural, only "code" and "errmsg" should be in each subdocument (not "errInfo"), and the bson_error_t should be filled out with a domain, code, and message.

      https://github.com/mongodb/specifications/blob/master/source/driver-bulk-update.rst#handling-write-concern-errors

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: