[SERVER-68308] Write concern does not update w:0 to w:1 Created: 26/Jul/22 Updated: 05/Dec/22 Resolved: 08/Aug/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Huayu Ouyang | Assignee: | Backlog - Replication Team |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Replication
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
In extractWriteConcern this comment states that w:0 is interpreted identically as w:1. However, the place where it is supposed to be converted to w:1 never actually gets run because it is within an if (!clientSuppliedWriteConcern) statement, and w:0 is a clientSuppliedWriteConcern. There does not seem to be any other place in the codebase where w:0 would be updated to w:1. Additionally, it seems like there are some differences in the server/shell/tests in how w:0 and w:1 are treated (see scripting/mozjs/mongo.cpp, write_commands.cpp, crud_api.js, repl_set_config_validators.h, read_write_concern_defaults.cpp). I'm not sure if this is a bug and we want to actually change w:0 to w:1, in which case this should be moved outside of the if statement, or if we do actually want to keep w:0 as a separate thing that is not interpreted identically to w:1, in which case the comment should be updated. |
| Comments |
| Comment by Huayu Ouyang [ 08/Aug/22 ] |
|
I don't think w:0 writes ever become w:1 writes, even between mongos and the shards either because the conversion from w:0 to w:1 occurs only if the write concern is not "client-supplied", and w:0 counts as client-supplied. Since it doesn't seem like this is a customer concern, we are going to keep w:0 for now but just update the comments in extractWriteConcern to be more clear. Marking this as won't fix |