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.
- is depended on by
-
CDRIVER-2961 Support Retryable Writes on by Default
- Closed
- is related to
-
CDRIVER-3053 mongoc_collection_remove and delete alias fails if retryWrites=true
- Closed
-
CDRIVER-3052 Documentation examples should not use mongoc_collection_update
- Closed
- related to
-
CDRIVER-2840 Delete Many and Update Many fail with retryWrites enabled
- Closed