Skip to content

DOCPS-16201 counters for legacy op codes #6063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions source/reference/command/serverStatus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2042,6 +2042,35 @@ opcounters

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

.. serverstatus:: opcounters.deprecated

This section only appears in the :method:`db.serverStatus()` output
when one of the following, deprecated opcodes has been used:

.. code-block:: javascript

"deprecated": {
"opQuery": NumberLong(<num>),
"opGetMore": NumberLong(<num>),
"opKillCursors": NumberLong(<num>),
"opDelete": NumberLong(<num>),
"opUpdate": NumberLong(<num>),
"opInsert": NumberLong(<num>),
"total": NumberLong(<num>),
}

These opcodes were deprecated in MongoDB 5.0 and support for these
opcodes is removed in MongoDB 5.1. Starting in MongoDB 5.1,
:binary:`~bin.mongod` refuses requests that use a deprecated
opcode and increments the corresponding counter.

``OP_QUERY`` is an exception to the general rule.
:binary:`~bin.mongod` continues to support ``hello`` and
``isMaster`` requests that use ``OP_QUERY``. :binary:`~bin.mongod`
refuses any other ``OP_QUERY`` requests.

The counters are reset when :binary:`~bin.mongod` starts.

.. _server-status-opcountersrepl:
.. _server-status-opcounters-repl:

Expand Down
2 changes: 1 addition & 1 deletion source/release-notes/5.0-compatibility.txt
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ MongoDB 5.0 deprecates the following
- ``OP_KILL_CURSORS``

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

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

Expand Down
4 changes: 4 additions & 0 deletions source/release-notes/5.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ Aggregation Metrics
indicates how often
:ref:`match expressions <query-projection-operators-top>` ran.

Opcode Counters
- :serverstatus:`opcounters.deprecated` A count of how often
deprecated opcodes run.

Resharding Statistics
- :serverstatus:`shardingStatistics.resharding.lastOpEndingChunkImbalance`

Expand Down