In 5.0, we deprecated OP_QUERY find operations. The deprecation is surfaced to the user through logging a warning with log id 5578800, as well as incrementing the db.serverStatus().opcounters.deprecated.query counter.
We also intended to deprecate OP_QUERY commands other than isMaster/hello (since OP_QUERY isMaster command is used for the connection handshake). However, unlike OP_QUERY find operations, OP_QUERY commands are currently not reflected in either the logs or serverStatus. The task for this ticket is to add this logging and to bump the serverStatus counters when either mongod or mongos receives an OP_QUERY command other than "isMaster" or "hello". This needs to happen at a fairly high level in the service entry point, before the OP_QUERY command is upconverted to look like an OP_MSG request.
As a quick example of this problem in practice, I connected to the server with a 4.4 shell, forcing the shell to use the OP_QUERY RPC protocol, and then ran a command:
The log line for the ping command indicates that the protocol used was "op_query":
However, I see no deprecation warning in the logs, and the serverStatus counter is not incremented.
We should backport this ticket to 5.0, since 5.0 is where the deprecation is first in effect. We can also consider backporting the opcounters portion of the change to even older branches, although this is not strictly required.