[CDRIVER-4665] Client assertions in opts validation breaks existing usage for bulk API Created: 20/Jun/23  Updated: 01/Feb/24  Resolved: 21/Jun/23

Status: Closed
Project: C Driver
Component/s: Bulk API
Affects Version/s: 1.24.0
Fix Version/s: 1.24.1

Type: Bug Priority: Unknown
Reporter: Jeremy Mikola Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-2250 Upgrade libmongoc to 1.24.1 Closed
Problem/Incident
is caused by CDRIVER-4255 Add assertions for non-null client an... Closed

 Description   

Summary

CDRIVER-4255 added assertions for client and pool parameters throughout libmongoc, which subtly broke the PHP driver's use of bulk operations.

The PHP driver allows construction of a BulkWrite object independent of a client. This uses mongoc_bulk_operation_new instead of mongoc_collection_create_bulk_operation_with_opts. Applications then append insert, update, and delete operations to this object. At execution time, the BulkWrite object is passed to a client method (e.g. Manager::executeBulkWrite()), which calls mongoc_bulk_operation_set_client to assign the appropriate client.

The problematic addition in CDRIVER-4255 was adding assertions to mongoc-opts.c.template.



 Comments   
Comment by Githook User [ 21/Jun/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-4665 do not assert `client` in option parsing (#1314)

  • do not use `_id`

Avoids a duplicate key error in tests
Branch: r1.24
https://github.com/mongodb/mongo-c-driver/commit/9cfe088a128311adef7f4a54ce94114a5ea4eb22

Comment by Githook User [ 20/Jun/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-4665 do not assert `client` in option parsing (#1314)

  • do not use `_id`

Avoids a duplicate key error in tests
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/34ed4ec1b199f75f1481a2c2bae26a819860f548

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