[CDRIVER-3758] Do not validate options in read/write agnostic command helpers Created: 16/Jul/20 Updated: 31/Mar/22 |
|
| Status: | Backlog |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kevin Albertson | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
libmongoc has several generic command helpers that are read/write agnostic.
These helpers should not be inspecting or validating options supplied by the user. See this PR conversation for context: https://github.com/mongodb/mongo-c-driver/pull/662#discussion_r454365303 For example, most go through _mongoc_client_command_with_opts will call mongoc_cmd_parts_append_read_write to apply command options. In doing so, the server's wire version is checked for read/write concern support. This directly contradicts the read/write concern spec. Let's audit these helpers to and remove unnecessary validation. |
| Comments |
| Comment by Akadoc 23 [ 29/Jul/20 ] |
|
Hi ok I'm sorry for that, thank you for your explanations |
| Comment by Jeremy Mikola [ 29/Jul/20 ] |
|
pimi.gonz@gmail.com: Thanks for expressing an interest in contributing. This particular issue is in our backlog so it's not something we're able to budget time for at the moment. I would suggest starting with CDRIVER tickets that have a "neweng" or "new-eng" label (see: this search filter). Those tickets should be more approachable for a first time contributor and require little (if any) guidance. Also, please review the libmongoc contributing guidelines before starting on anything if you've not seen that document already. |
| Comment by Akadoc 23 [ 29/Jul/20 ] |
|
Hey, @Kevin Albertson so I've started to work on it: First of all, I realized two distincts functions that end up to be called by the related helpers, that may check or validate read/write concern. The second one is less frequently called "mongoc_cursor_new_with_opts" (in mongoc-cursor.c), I've noticed there is a check (at line 288) about the read concern in case there is specified options, but I don't know if it is supposed to be removed. So could you please tell me if I have to remove these checks, and if am I on the right way ? Thank you |
| Comment by Akadoc 23 [ 24/Jul/20 ] |
|
Hey I'm a new contributor and I want to help on the mongo C Driver, I've read the attached link to get more context, it's a bit blurry for now but I think by reading this again and exploring code it would help me. May I be assigned on it ? |