-
Type: Spec Change
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Component/s: Bulk API
-
None
-
Needed
-
Summary
Always populate BulkWriteException.partialResult with known results. Make partialResult a non-optional field.
Motivation
Quoting the bulk write spec:
If any operations were successful (i.e. nErrors is less than the number of operations that were sent), drivers MUST record the summary count fields in a BulkWriteResult to be returned to the user or embedded in a BulkWriteException. Drivers MUST NOT populate the partialResult field in BulkWriteException if no operations were successful.
nErrors may be less than the number of operations sent when no operation succeeded. For example, an ordered bulk write may send 2 operations and fail on the first. No operations succeeded, but nErrors reports 1. (See example with mongosh).
Only setting partialResult when there are known successful results may add implementation complexity and might not give much additional useful information to callers.
See slack thread.
Who is the affected end user?
Implementers and users of MongoClient.bulkWrite (DRIVERS-716).
How does this affect the end user?
N/A?
How likely is it that this problem or use case will occur?
Certain?
If the problem does occur, what are the consequences and how severe are they?
N/A?
Is this issue urgent?
May be good to do before others implement DRIVERS-716.
Is this ticket required by a downstream team?
No?
Is this ticket only for tests?
No.
Acceptance Criteria
Always populate BulkWriteException.partialResult with known results. Make partialResult a non-optional field.
- is related to
-
DRIVERS-716 Improved Bulk Write API
- In Progress
- split to
-
CDRIVER-5718 Fix logic for determining whether to populate BulkWriteError.partialResult
- Blocked
-
CSHARP-5283 Fix logic for determining whether to populate BulkWriteError.partialResult
- Blocked
-
CXX-3106 Fix logic for determining whether to populate BulkWriteError.partialResult
- Blocked
-
GODRIVER-3349 Fix logic for determining whether to populate BulkWriteError.partialResult
- Blocked
-
JAVA-5610 Fix logic for determining whether to populate BulkWriteError.partialResult
- Blocked
-
MOTOR-1366 Fix logic for determining whether to populate BulkWriteError.partialResult
- Blocked
-
NODE-6384 Fix logic for determining whether to populate BulkWriteError.partialResult
- Blocked
-
PHPLIB-1526 Fix logic for determining whether to populate BulkWriteError.partialResult
- Blocked
-
PYTHON-4766 Fix logic for determining whether to populate BulkWriteError.partialResult
- Blocked
-
RUBY-3542 Fix logic for determining whether to populate BulkWriteError.partialResult
- Blocked
-
RUST-2037 Fix logic for determining whether to populate BulkWriteError.partialResult
- Blocked