Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3051

Using multi flag with mongoc_collection_update fails if retryWrites=true

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.15.0
    • Affects Version/s: 1.10.0
    • Component/s: libmongoc
    • None

      When the MONGOC_UPDATE_MULTI_UPDATE update flag is used with mongoc_collection_update(), it fails to set the has_multi_write flag on the constructed mongoc_write_command_t. This causes _mongoc_write_opmsg() to set allow_txn_number to "yes" and the server returns a command error for including a txnNumber field in a multi-write.

      This bug was only caught by test_example_53() in test-mongoc-sample-commands.c (documentation examples), so I think we should also add a proper test in test-mongoc-collection.c.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: