[SERVER-56142] Modernize writeConcern w:0 handling in the shell Created: 16/Apr/21 Updated: 27/Oct/23 Resolved: 10/May/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | James Wahlin | Assignee: | Eric Cox (Inactive) |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Sprint: | Query Execution 2021-05-17 | ||||||||
| Participants: | |||||||||
| Description |
|
When the mongo shell sends a w:0 write, it will do so using the legacy write protocol. Modern drivers will instead send an `OP_MSG` with the `moreToCome` but set, a path that we may not be currently testing in our integration test suite. We could consider making changes to use the legacy wire protocol when the shell is in `writeMode:legacy` and using `OP_MSG` for the default `writeMode:commands`. |
| Comments |
| Comment by David Storch [ 10/May/21 ] |
|
To add to what eric.cox said, it does not appear that the original problem described by this ticket actually exists. The shell is already using OP_MSG for w:0 writes, so there is no modernization necessary to make the shell stop using OP_INSERT, OP_DELETE, and OP_UPDATE. Hence, we have resolved this ticket as "Works as Designed". |
| Comment by Eric Cox (Inactive) [ 10/May/21 ] |
|
We got to the bottom of this. It turns out that apiVersion parameters weren't being sent from the DBClient in the "fire and forget" path using the OP_MSG protocol when a write concern w:0 used. However, the original author jesse wanted to fix the bug since he implemented the other write concern cases. That is work is being tracked in |
| Comment by A. Jesse Jiryu Davis [ 08/May/21 ] |
|
Sorry, this should be closed as a dupe of |
| Comment by David Storch [ 30/Apr/21 ] |
|
milkie are you referring to old versions of the mongo shell, or are you saying that any version of mongo is legacy/deprecated due to mongosh? Assuming it is the former, I'm not sure how much we should worry about it. But I do think we have the option to backport the work done under this ticket. |
| Comment by Eric Milkie [ 30/Apr/21 ] |
|
Does it change anything if it's not a modern but a legacy, deprecated shell depending on deprecated opcodes? |
| Comment by David Storch [ 29/Apr/21 ] |
|
I'm re-opening this and moving it to the Query Execution team backlog. We are considering deprecating the legacy wire protocol ops, including OP_INSERT, OP_UPDATE, and OP_DELETE. As part of this effort, it would be good to ensure that a modern shell does not depend on the deprecated op codes for unacknowledged write operations. |
| Comment by Brooke Miller [ 26/Apr/21 ] |
|
Reviewed this with robert.guo in triage and decided to close this as Won't Fix, since there's no immediate need to do this for testing purposes. Also, this seems like non-trivial change to accommodate this in the legacy shell for testing purposes. However, if this is highly desired, please feel free to re-open this ticket. |