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

Fix logic for determining whether to populate BulkWriteError.partialResult

    • Type: Icon: Spec Change Spec Change
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Component/s: Bulk API
    • None
    • Needed
    • Hide

      Summary of necessary driver changes

      •  

      Commits for syncing spec/prose tests
      (and/or refer to an existing language POC if needed)

      •  

      Context for other referenced/linked tickets

      •  
      Show
      Summary of necessary driver changes   Commits for syncing spec/prose tests (and/or refer to an existing language POC if needed)   Context for other referenced/linked tickets  
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-5718 Blocked
      CXX-3106 Blocked
      CSHARP-5283 Blocked
      GODRIVER-3349 Blocked
      JAVA-5610 Blocked
      NODE-6384 Blocked
      MOTOR-1366 Blocked
      PYTHON-4766 Blocked
      PHPLIB-1526 Blocked
      RUBY-3542 Blocked
      RUST-2037 Blocked
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-5718 Blocked CXX-3106 Blocked CSHARP-5283 Blocked GODRIVER-3349 Blocked JAVA-5610 Blocked NODE-6384 Blocked MOTOR-1366 Blocked PYTHON-4766 Blocked PHPLIB-1526 Blocked RUBY-3542 Blocked RUST-2037 Blocked

      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.

            Assignee:
            isabel.atkinson@mongodb.com Isabel Atkinson
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Kevin Albertson Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: