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

/BulkOperation/multiple_errors fails with missing document in errorReplies

      Observed to fail in this patch, followed by success in a following patch.

      The errorReplies array is expected to have two documents with "code": 8, one for each command that triggers a failPoint, but only one error reply is observed in the result.

      Expected:

      {
          "nInserted": 2,
          "nMatched": 0,
          "nModified": 0,
          "nRemoved": 1,
          "nUpserted": 0,
          "errorReplies": [{ "code": 8 }, { "code": 8 }],
          "writeErrors": [{ "index": 5 }]
      }
      

      Actual (unrelated fields omitted for brevity):

      {
          "nInserted": { "$numberInt": "2" },
          "nMatched": { "$numberInt": "0" },
          "nModified": { "$numberInt": "0" },
          "nRemoved": { "$numberInt": "1" },
          "nUpserted": { "$numberInt": "0" },
          "writeErrors": [
              {
                  "index": { "$numberInt": "5" },
                  "code": { "$numberInt": "11000" },
                  "errmsg": "E11000 duplicate key error collection: test.test_bulk_write_multiple_errors_1654274678_23677 index: _id_ dup key: { _id: 5 }",
                  "keyPattern": { "_id": { "$numberInt": "1" } },
                  "keyValue": { "_id": { "$numberInt": "5" } }
              }
          ],
          "errorReplies": [
              {
                  "ok": { "$numberDouble": "0.0" },
                  "errmsg": "Failing command via 'failCommand' failpoint",
                  "code": { "$numberInt": "8" },
                  "codeName": "UnknownError",
              }
          ]
      }
      

       

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            ezra.chung@mongodb.com Ezra Chung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: