[CDRIVER-2840] Delete Many and Update Many fail with retryWrites enabled Created: 01/Oct/18  Updated: 28/Oct/23  Resolved: 05/Oct/18

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: 1.10.0
Fix Version/s: 1.14.0

Type: Bug Priority: Major - P3
Reporter: Amy Giersch Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

AIX


Attachments: Text File update_many_delete_many_apm.txt    
Issue Links:
Gantt Dependency
Problem/Incident
is caused by CDRIVER-2373 IDL for functions that take flexible ... Closed
Related
is related to CDRIVER-3051 Using multi flag with mongoc_collecti... Closed
is related to CDRIVER-3053 mongoc_collection_remove and delete a... Closed

 Description   

Discovered in testing with 1.12.0, still an issue in 1.13.0.  Previously working in 1.9.4.  Have not built 1.10.0 or 1.11.0 (cannot confirm which version this stopped working)

Testing against 3.6.

Connection string with retryWrites=true

mongoc_collection_delete_many() and mongoc_collection_update_many() both return an error as the request contains the "txnNumber" field.

delete:  "writeErrors" : [ { "index" : 0, "code" : 72, "errmsg" : "Cannot use (or request) retryable writes with limit=0" }

update:  "writeErrors" : [ { "index" : 0, "code" : 72, "errmsg" : "Cannot use (or request) retryable writes with multi=true" }

The APM log for both is attached.  The txnNumber field is set in both requests even though these requests do not support retryable writes.  (The retryable writes spec states "Drivers MUST NOT add a transaction ID to any single- or multi-statement write commands that include one or more multi-document write operations.")

A workaround is to use bulk operation instead.

 



 Comments   
Comment by Githook User [ 05/Oct/18 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: CDRIVER-2840 update/delete_many ignore retrywrites

These commands do not support retryable writes; they must not add txnId.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/daf35597d9612f223ac7c0ae0f263ee2d0f01c39

Comment by A. Jesse Jiryu Davis [ 02/Oct/18 ]

Git bisecting, and reading diffs, suggests this change in 1.10.0 is buggy:

https://github.com/mongodb/mongo-c-driver/commit/db384740ed0f81c1a044f764e369fe8f26ce1438#diff-4a0fdf60d158a368481203d254179434R180

 

Comment by A. Jesse Jiryu Davis [ 01/Oct/18 ]

Thanks for the terrific bug report. We'll fix this in 1.14.0. Is your workaround reasonably convenient for now?

Generated at Wed Feb 07 21:16:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.