Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-2093

How should drivers handle multiple WriteConcernErrors in a bulk operation

    • Type: Icon: Spec Change Spec Change
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: CRUD
    • None
    • Needed

      According to the CRUD spec, a BulkWriteException contains an optional array of WriteError s and a single optional WriteConcernError. It isn't immediately clear to me based on the spec how drivers should handle the case of multiple write concern related errors.

      Our current implementations seem divided on this too:

      The legacy bulk-update spec opts for an array:

      Previous versions of this spec were ambiguous about reporting writeConcernErrors. Some clients include a singular field "writeConcernError" in bulk results; the singular form is now deprecated and an array called "writeConcernErrors" is required.

      Though I'm not sure how relevant that spec is these days.

      So my questions are:

      • If the spec is correct in specifying a single write concern error should be reported by a BulkWriteException , how should drivers choose which one? Does it matter?
      • Or should the spec be updated such that all the write concern errors are reported?

            Assignee:
            Unassigned Unassigned
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: