-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Bulk API
-
None
Currently, ClientBulkWriteOperation.exhaustBulkWriteCommandOkResponseCursor/exhaustBulkWriteCommandOkResponseCursorAsync
- either succeed exhausting a cursor, causing all the cursor documents (results of individual operations in a batch) to be accumulated via ResultAccumulator.onBulkWriteCommandOkResponseOrNoResponse/onBulkWriteCommandOkResponseWithWriteConcernError and provided to an application in ClientBulkWriteResult/ClientBulkWriteException;
- or, if a top-level error happens, discard all the documents received from this particular cursor (batch) so far, causing them to be omitted from the ClientBulkWriteException.
I did not find anything in the [specification](https://github.com/mongodb/specifications/blob/master/source/crud/bulk-write.md) that clearly states that the current behavior described above is incorrect. Nor there are relevant unified/prose tests that we currently fail. However, it seems that the spirit of BulkWriteException is to report to an application as much about the succeeded individual write operations, as possible. Thus, ClientBulkWriteOperation should not discard the cursor documents it had observed before exhausting failed with a top-level error.
For reference, Go, C, C++ drivers do not discard documents from a partially exhausted cursor.
- is related to
-
DRIVERS-3542 Clarify that partial cursor results must be preserved in BulkWriteException when a top-level error occurs during getMore
-
- In Review
-