Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2207

Large bulk writes not always splitting correctly

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.1
    • Affects Version/s: 2.5
    • Component/s: Write Operations
    • None
    • Environment:
      MongoDB 3.6.3
      MongoDB c# Driver 2.5.0

      From: https://docs.mongodb.com/manual/reference/limits/

      Write Command Batch Limit Size

      100,000 writes are allowed in a single batch operation, defined by a single request to the server.

      Changed in version 3.6: The limit raises from 1,000 to 100,000 writes. This limit also applies to legacy OP_INSERT messages.

      We are using MongoDB C# driver 2.5.

      This change is causing a lot of issues like:

      • InsertMany is now failing when large batch are sent to MongoDB 3.6.3.
      • WriteBulkAsync is failing when many WriteModels are sent to MongoDB 3.6.3
        Error is Command insert failed: BSONObj size: 16793671 (0x1004047) is invalid. Size must be between 0 and 16793600(16MB)

      We had to change code on our side to split manually InserMany operation in multiple batch and same for bulk operations, but we can't be sure that size will not be over 16MB. I think this should be handled by Driver and moreover it should be possible to change this limit on server settings side in order to let customer being able to tune it accordingly to specific usage.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            ivan.fioravanti@4ward.it Ivan Fioravanti
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: