Skip to content

Commit cd45013

Browse files
mungitoperritojeff-allen-mongo
authored andcommitted
DOCPS-16201 counters for legacy op codes
1 parent bb5b791 commit cd45013

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

source/reference/command/serverStatus.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,6 +2042,35 @@ opcounters
20422042

20432043
.. include:: /includes/extracts/4.2-changes-opcounters-type.rst
20442044

2045+
.. serverstatus:: opcounters.deprecated
2046+
2047+
This section only appears in the :method:`db.serverStatus()` output
2048+
when one of the following, deprecated opcodes has been used:
2049+
2050+
.. code-block:: javascript
2051+
2052+
"deprecated": {
2053+
"opQuery": NumberLong(<num>),
2054+
"opGetMore": NumberLong(<num>),
2055+
"opKillCursors": NumberLong(<num>),
2056+
"opDelete": NumberLong(<num>),
2057+
"opUpdate": NumberLong(<num>),
2058+
"opInsert": NumberLong(<num>),
2059+
"total": NumberLong(<num>),
2060+
}
2061+
2062+
These opcodes were deprecated in MongoDB 5.0 and support for these
2063+
opcodes is removed in MongoDB 5.1. Starting in MongoDB 5.1,
2064+
:binary:`~bin.mongod` refuses requests that use a deprecated
2065+
opcode and increments the corresponding counter.
2066+
2067+
``OP_QUERY`` is an exception to the general rule.
2068+
:binary:`~bin.mongod` continues to support ``hello`` and
2069+
``isMaster`` requests that use ``OP_QUERY``. :binary:`~bin.mongod`
2070+
refuses any other ``OP_QUERY`` requests.
2071+
2072+
The counters are reset when :binary:`~bin.mongod` starts.
2073+
20452074
.. _server-status-opcountersrepl:
20462075
.. _server-status-opcounters-repl:
20472076

source/release-notes/5.0-compatibility.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ MongoDB 5.0 deprecates the following
471471
- ``OP_KILL_CURSORS``
472472

473473
Newer driver versions use :ref:`OP_MSG <wire-op-msg>` instead of these
474-
deprecated op codes.
474+
deprecated opcodes.
475475

476476
The related commands and methods are also deprecated in MongoDB 5.0:
477477

source/release-notes/5.1.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ Aggregation Metrics
115115
indicates how often
116116
:ref:`match expressions <query-projection-operators-top>` ran.
117117

118+
Opcode Counters
119+
- :serverstatus:`opcounters.deprecated` A count of how often
120+
deprecated opcodes run.
121+
118122
Resharding Statistics
119123
- :serverstatus:`shardingStatistics.resharding.lastOpEndingChunkImbalance`
120124

0 commit comments

Comments
 (0)