[CSHARP-2681] $query gets incorrectly wrapped around command messages Created: 08/Aug/19  Updated: 13/Jul/20  Resolved: 13/Jul/20

Status: Closed
Project: C# Driver
Component/s: Testing
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Katie Sadoff Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

In the process of testing CSHARP-2632, we discovered that there is a bug in the transformation of the OP_QUERY based command into a pseudo command for APM purposes (for server versions 3.2 and 3.4).

$query is an artifact of OP_QUERY commands. It should not be present in the pseudo command manufactured for APM, but we saw pseudo commands that looked like

 

{ "$query" : { "find" : "testcollection", "filter" : { "x" : 2 } }, "$readPreference" : { "mode" : "primaryPreferred" } }

 

Additionally, for 3.0 and lower, "$readPreference" gets incorrectly changed to "readPreference", which does not match current standards for command messages.

The actual wrapping of the message takes place in CommandUsingQueryMessageWireProtocol.cs, which may be a good place to start.

For reference, https://evergreen.mongodb.com/version/5d42f783d1fe07102ee6a681 is an evergreen patch that shows this incorrect behavior.


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