Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1541

unordered bulk writes should continue sending batches after an error

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 2.12.5
    • Affects Version/s: 2.12.0
    • Component/s: Write Operations

      The bulk write API added in 2.12 supports sending inserts, updates, and deletes in bulk to the server. If the number of writes requests exceeds 1000, or the total size of the write requests exceed 16MB, the driver will split the write requests into batches of 1000 and/or batches whose size does not exceed 16MB.

      For ordered bulk writes, the driver stops sending more batches to the server if there were any errors reported in the current batch.

      For unordered bulk writes, the driver should keep sending the rest of the batches to the server, even if errors were reported in the current batch. There is a bug which is preventing that from happening. Instead, the driver stops sending more batches and immediately reports the first batch of errors to the application, ignoring any subsequent batches.

      An application will be effected by this bug in the following circumstances:

      • It is using the method DBCollection.initializeUnorderedBulkWriteOperation
      • The number of writes added to the operation exceeds 1000 or 16MB of total data
      • The possibility of an error (most likely a duplicate key error) exists

      Workaround:

      Limit the number of writes in a single bulk write operation to less than 1000 and less than 16 MB

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            alex.komyagin@mongodb.com Alexander Komyagin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: