[CXX-1939] Revisit deprecation of client read_concern, write_concern, and read_preference methods Created: 12/Feb/20  Updated: 31/Mar/22

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

Type: Task Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-3537 Pooled clients should clear state whe... Backlog
Related
related to CXX-1931 Remove code deprecated in previous re... Closed

 Description   

CXX-1086 deprecated several methods on client that deal with setting and getting read_concern, write_concern, and read_preference.  However, if CDRIVER-3537 is fixed, these methods may no longer be problematic.  Additionally, there are several related methods on client that were not deprecated in CXX-1086, including the getters for read_concern and read_preference.  Revisit these and either deprecate/remove all related methods, or un-deprecate them once the C driver can accommodate these settings.



 Comments   
Comment by Kevin Albertson [ 13/Feb/20 ]

Copying my comment from the code review of CXX-1931 regarding the deprecation of the read_concern setter on a client:

This reasoning seems slightly wrong. The same logic applies to setting a
read/write concern at the database level. It won't apply to collection instances
that have already been created.

I looked at the ticket that deprecated this,
https://jira.mongodb.org/browse/CXX-1086.

The more compelling reason is that the documentation for
mongoc_client_set_read_concern has the warning:

"It is a programming error to call this function on a client from a
mongoc_client_pool_t. For pooled clients, set the read concern with the MongoDB
URI instead."

See: http://mongoc.org/libmongoc/current/mongoc_client_set_read_concern.html

After a little bit of digging, it seems the reason is that a read concern set on
a pooled client isn't cleared before being pushed back onto the pool:
https://jira.mongodb.org/browse/CDRIVER-3537

If that were fixed, I wonder if there's still a reason to have this deprecated.

Generated at Wed Feb 07 22:04:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.