ClientBulkWriteOperation should not discard observed cursor results if exhausting it fails with a top-level error

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Bulk API
    • None
    • Java Drivers
    • None
    • None
    • None
    • None
    • None
    • 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.

            Assignee:
            Unassigned
            Reporter:
            Valentin Kavalenka
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: