-
Type: Spec Change
-
Resolution: Won't Do
-
Priority: 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 C driver, for example, returns an array of all the write concern errors.
- The PHP driver simply selects the first one.
- The shell documentation suggests that an array is returned.
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?
- is related to
-
DRIVERS-2090 Discuss errors that may interrupt a bulk write regardless of ordering
- Backlog
- related to
-
DRIVERS-716 Improved Bulk Write API
- In Progress
-
DRIVERS-2159 How should drivers handle non-write errors in Unordered Bulk Writes?
- Backlog