[CDRIVER-3477] _mongoc_bulk_operation_update_append does not update has_array_filters for subsequent update operations Created: 08/Jan/20  Updated: 28/Oct/23  Resolved: 18/May/20

Status: Closed
Project: C Driver
Component/s: Bulk API
Affects Version/s: None
Fix Version/s: 1.17.0-beta2, 1.17.0

Type: Bug Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Roberto Sanchez
Resolution: Fixed Votes: 0
Labels: low-hanging-fruits, new-eng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-3531 Do not require session support to run... Closed
Duplicate
is duplicated by CDRIVER-3675 Test arrayFilters on non-supporting s... Closed
Related
is related to CDRIVER-2664 Raise client error if arrayFilters op... Closed
is related to CDRIVER-3400 support ability to pass hint to update Closed
is related to CXX-2019 Test arrayFilters on non-supporting s... Closed

 Description   

CDRIVER-2664 added tracking of arrayFilters in c4af4aa so that an error could be raised if the option was used for unsupported servers. While implementing support for the hint option in CDRIVER-3400, I realized that _mongoc_bulk_operation_update_append only appears to set mongoc_write_command_t.flags.has_array_filters when initializing a new update command in the bulk. This is in contract to the existing has_collation and has_multi_write flags, which are also updated with an |= assignment when appending an update operation to an existing update command.

Assuming this was an oversight, I think the appropriate test would be to execute a bulk write with two updates against a <3.6 server when only the second update uses arrayFilters. The driver should raise a client-side error to conform with the CRUD specification. Rather than implement this as a prose test specific to the C driver, it may make sense to contribute it directly to the specifications repo so all drivers can benefit.



 Comments   
Comment by Githook User [ 25/May/20 ]

Author:

{'name': 'Roberto C. Sánchez', 'email': 'roberto@connexer.com', 'username': 'rcsanchez97'}

Message: CDRIVER-3477 handle arrayFilters on second and subsequent ops
Branch: r1.17
https://github.com/mongodb/mongo-c-driver/commit/1ea6d4b398e80342bb9c911ed2109d0d0cf6a3e7

Comment by Githook User [ 18/May/20 ]

Author:

{'name': 'Roberto C. Sánchez', 'email': 'roberto@connexer.com', 'username': 'rcsanchez97'}

Message: CDRIVER-3477 handle arrayFilters on second and subsequent ops
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/c63f92c305234d4595caf2bf73111ad08c83342d

Comment by Roberto Sanchez [ 13/May/20 ]

jmikola kevin.albertson, I have what I believe to be an appropriate spec test that captures this scenario. Should I write a SPEC and/or DRIVERS ticket, or just go straight to a PR in the specifications repo?

Comment by Roberto Sanchez [ 12/May/20 ]

In order to successfully execute bulkWrite against a server <3.6, it is necessary that the CRUD test suite not require sessions, thus blocking on CDRIVER-3531.

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