[CDRIVER-3595] find_and_modify has extraneous checks for write concern inheritance Created: 30/Mar/20  Updated: 28/Oct/23  Resolved: 17/Jul/20

Status: Closed
Project: C Driver
Component/s: libmongoc, Transactions
Affects Version/s: None
Fix Version/s: 1.18.0, 1.18.0-alpha

Type: Improvement Priority: Major - P3
Reporter: Kevin Albertson Assignee: Andrew Witten (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Tested
tested by CDRIVER-3273 Audit options inheritance within a tr... Backlog

 Description   

As discovered by andreas.braun as part of CDRIVER-3552, the logic for checking whether inheriting a write concern is permissible in mongoc_collection_find_and_modify_with_opts is confusing.

1. Write concern is not inherited from the collection if it is unacknowledged.

Being unacknowledged should not prevent it from being inherited. It's possible the call to mongoc_write_concern_is_acknowledged was mistaken for mongoc_write_concern_is_default and that the intent was not to inherit the default write concern.

2. An acknowledged write concern is inherited from the collection and applied to an operation within a transaction

But transactions should not be inheriting write concerns from the collection.



 Comments   
Comment by Githook User [ 17/Jul/20 ]

Author:

{'name': 'Andrew Witten', 'email': 'andrew.witten@mongodb.com', 'username': 'awitten1'}

Message: CDRIVER-3595 adds tests, removes extraneous check

  • changed comment
Comment by Andrew Witten (Inactive) [ 12/Jul/20 ]

PR: https://github.com/mongodb/mongo-c-driver/pull/660

Comment by Kevin Albertson [ 11/Jun/20 ]

The first point might not be an issue, since the server ignores unacknowledged anyways according to jmikola.

But the second point is something we should definitely address if that is an issue.

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