[CDRIVER-1492] Correct handling of Bulk Retry Created: 26/Aug/16  Updated: 11/Sep/19  Resolved: 26/Aug/16

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: John Page Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

With the major Driver refactoring for 3.2, most of the drivers seem to have decoupled the list of operations in a bulk operation from the function performing them. This means if a bulk op fails you can resubmit it, this is important in handling replica set elections.

Python, PHP, Java and Javascript all follow this pattern.

https://docs.mongodb.com/manual/reference/method/db.collection.bulkWrite/

But the C driver appears not to have this part implemented yet and uses the older pattern of creating a BulkOperation 'object' and adding things to it - the problem with that is that according to the docs, you cannot re-submit a failed operation, So if it fails because there was no primary, or because the primary failed part way through - you cannot simply wait, resubmit and ignore duplicate _id's

What is the correct form for handling bulk insert operations ( or idempotent bulk updates, or deletes) during failover when using the C driver?



 Comments   
Comment by A. Jesse Jiryu Davis [ 26/Aug/16 ]

Right, since we're not necessarily planning to implement the same CRUD API as the other drivers (CDRIVER-637), retrying idempotent operations has to be done differently in the C Driver. You'll need to create a new mongoc_bulk_operation_t. Retry the sequence of operations beginning with mongoc_collection_create_bulk_operation through mongoc_bulk_operation_execute.

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