Skip to content

Commit 97ad9dc

Browse files
committed
DOCS-11282: shardingStatus
1 parent 80954c6 commit 97ad9dc

File tree

6 files changed

+161
-16
lines changed

6 files changed

+161
-16
lines changed

source/core/sharding-balancer-administration.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ All chunk migrations use the following procedure:
137137
starts receiving copies of the data. See also
138138
:ref:`chunk-migration-replication`.
139139

140-
#. After receiving the final document in the chunk, the destination
141-
shard starts a synchronization process to ensure that it has the
142-
changes to the migrated documents that occurred during the migration.
140+
#. After receiving the final document in the chunk, the
141+
destination shard starts a synchronization process to ensure that it
142+
has the changes to the migrated documents that occurred during the
143+
migration.
143144

144145
#. When fully synchronized, the source shard connects to the
145146
:term:`config database` and updates the cluster metadata with the new

source/includes/extracts-server-status-projection-base.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ content: |
1010
included by default, specify the top-level field and set to ``0`` in
1111
the command.
1212
---
13-
ref: _serverStatus-output-change-v3.0
13+
ref: _serverStatus-output-changes
1414
content: |
1515
16-
.. versionchanged:: 3.0
16+
- .. versionchanged:: 3.0
1717
18-
{{operationName}} no longer outputs the ``workingSet``,
19-
``indexCounters``, and ``recordStats`` sections.
18+
{{operationName}} no longer outputs the ``workingSet``,
19+
``indexCounters``, and ``recordStats`` sections.
20+
21+
- .. versionchanged:: 4.0
22+
23+
{{operationName}} includes :serverstatus:`shardingStatistics` in its output.
2024
...

source/includes/extracts-server-status-projection.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ inherit:
1212
replacement:
1313
operationName: ":method:`db.serverStatus()`"
1414
---
15-
ref: serverStatus-command-output-change-v3.0
15+
ref: serverStatus-command-output-change
1616
inherit:
17-
ref: _serverStatus-output-change-v3.0
17+
ref: _serverStatus-output-changes
1818
file: extracts-server-status-projection-base.yaml
1919
replacement:
2020
operationName: ":dbcommand:`serverStatus`"
2121
---
22-
ref: serverStatus-method-output-change-v3.0
22+
ref: serverStatus-method-output-change
2323
inherit:
24-
ref: _serverStatus-output-change-v3.0
24+
ref: _serverStatus-output-changes
2525
file: extracts-server-status-projection-base.yaml
2626
replacement:
2727
operationName: ":method:`db.serverStatus()`"

source/reference/command/serverStatus.txt

Lines changed: 139 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Output
6666
For the :dbcommand:`serverStatus` output specific to the version of
6767
your MongoDB, refer to the appropriate version of the MongoDB Manual.
6868

69-
.. include:: /includes/extracts/serverStatus-command-output-change-v3.0.rst
69+
.. include:: /includes/extracts/serverStatus-command-output-change.rst
7070

7171
.. _server-status-instance-information:
7272

@@ -616,7 +616,7 @@ logicalSessionRecordCache
616616
.. serverstatus:: logicalSessionRecordCache.lastSessionsCollectionJobEntriesEnded"
617617

618618
The number of sessions that ended during the last refresh.
619-
619+
620620
.. serverstatus:: logicalSessionRecordCache.lastSessionsCollectionJobCursorsClosed"
621621

622622
The number of cursors that were closed during the last
@@ -1205,7 +1205,7 @@ sharding
12051205
the shard member has seen. The optime document includes:
12061206

12071207
.. include:: /includes/fact-optime.rst
1208-
1208+
12091209
The :serverstatus:`~sharding.lastSeenConfigServerOpTime` is present
12101210
only if the sharded cluster uses CSRS.
12111211

@@ -1218,6 +1218,142 @@ sharding
12181218
:serverstatus:`~sharding.maxChunkSizeInBytes` may not reflect the
12191219
most recent value.
12201220

1221+
.. _server-status-sharding-statistics:
1222+
1223+
shardingStatistics
1224+
~~~~~~~~~~~~~~~~~~
1225+
1226+
.. versionadded:: 4.0
1227+
1228+
.. code-block:: javascript
1229+
1230+
"shardingStatistics" : {
1231+
"countStaleConfigErrors" : NumberLong(<num>),
1232+
"countDonorMoveChunkStarted" : NumberLong(<num>),
1233+
"totalDonorChunkCloneTimeMillis" : NumberLong(<num>),
1234+
"totalCriticalSectionCommitTimeMillis" : NumberLong(<num>),
1235+
"totalCriticalSectionTimeMillis" : NumberLong(<num>),
1236+
"catalogCache" : {
1237+
"numDatabaseEntries" : NumberLong(<num>),
1238+
"numCollectionEntries" : NumberLong(<num>),
1239+
"countStaleConfigErrors" : NumberLong(<num>),
1240+
"totalRefreshWaitTimeMicros" : NumberLong(<num>),
1241+
"numActiveIncrementalRefreshes" : NumberLong(<num>),
1242+
"countIncrementalRefreshesStarted" : NumberLong(<num>),
1243+
"numActiveFullRefreshes" : NumberLong(<num>),
1244+
"countFullRefreshesStarted" : NumberLong(<num>),
1245+
"countFailedRefreshes" : NumberLong(<num>)
1246+
}
1247+
},
1248+
1249+
.. serverstatus:: shardingStatistics
1250+
1251+
A document which contains metrics on metadata refresh on sharded
1252+
clusters.
1253+
1254+
.. serverstatus:: shardingStatistics.countStaleConfigErrors
1255+
1256+
The total number of times that threads hit stale config exception.
1257+
Since a stale config exception triggers a refresh of the metadata,
1258+
this number is roughly proportional to the number of metadata
1259+
refreshes.
1260+
1261+
*Only present when run on a shard.*
1262+
1263+
.. serverstatus:: shardingStatistics.countDonorMoveChunkStarted
1264+
1265+
The total number of times that the :dbcommand:`moveChunk` command
1266+
has started on the shard, of which this node is a member, as part of
1267+
a :ref:`chunk migration process <chunk-migration-procedure>`. This
1268+
increasing number does not consider whether the chunk migrations
1269+
succeed or not.
1270+
1271+
*Only present when run on a shard.*
1272+
1273+
.. serverstatus:: shardingStatistics.totalDonorChunkCloneTimeMillis
1274+
1275+
The cumulative time, in milliseconds, taken by the :ref:`clone phase
1276+
of the chunk migrations <chunk-migration-procedure>` from this
1277+
shard, of which this node is a member. Specifically, for each
1278+
migration from this shard, the tracked time starts with the
1279+
:dbcommand:`moveChunk` command and ends before the destination shard
1280+
enters a catch-up phase to apply changes that occurred during the
1281+
:ref:`chunk migrations <chunk-migration-procedure>`.
1282+
1283+
*Only present when run on a shard.*
1284+
1285+
.. serverstatus:: shardingStatistics.totalCriticalSectionCommitTimeMillis
1286+
1287+
The cumulative time, in milliseconds, taken by the :ref:`update
1288+
metadata phase of the chunk migrations <chunk-migration-procedure>`
1289+
from this shard, of which this node is a member. During the update
1290+
metadata phase, all operations on the collection are blocked.
1291+
1292+
*Only present when run on a shard.*
1293+
1294+
.. serverstatus:: shardingStatistics.totalCriticalSectionTimeMillis
1295+
1296+
The cumulative time, in milliseconds, taken by the :ref:`catch-up
1297+
phase and the update metadata phase of the chunk migrations
1298+
<chunk-migration-procedure>` from this shard, of which this node is
1299+
a member.
1300+
1301+
To calculate the duration of the catch-up phase, subtract
1302+
:serverstatus:`~shardingStatistics.totalCriticalSectionCommitTimeMillis` from
1303+
:serverstatus:`~shardingStatistics.totalCriticalSectionTimeMillis`
1304+
1305+
.. code-block:: none
1306+
1307+
totalCriticalSectionTimeMillis - totalCriticalSectionCommitTimeMillis
1308+
1309+
Only present when run on a shard.
1310+
1311+
.. serverstatus:: shardingStatistics.catalogCache
1312+
1313+
A document with statistics about the cluster's routing information cache.
1314+
1315+
.. serverstatus:: shardingStatistics.catalogCache.numDatabaseEntries
1316+
1317+
The total number of database entries that are currently in the
1318+
catalog cache.
1319+
1320+
.. serverstatus:: shardingStatistics.catalogCache.numCollectionEntries
1321+
1322+
The total number of collection entries (across all databases) that
1323+
are currently in the catalog cache.
1324+
1325+
.. serverstatus:: shardingStatistics.catalogCache.countStaleConfigErrors
1326+
1327+
The total number of times that threads hit stale config exception. A
1328+
stale config exception triggers a refresh of the metadata.
1329+
1330+
.. serverstatus:: shardingStatistics.catalogCache.totalRefreshWaitTimeMicros
1331+
1332+
The cumulative time, in microseconds, that threads had to wait for a
1333+
refresh of the metadata.
1334+
1335+
.. serverstatus:: shardingStatistics.catalogCache.numActiveIncrementalRefreshes
1336+
1337+
The number of incremental catalog cache refreshes that are currently
1338+
waiting to complete.
1339+
1340+
.. serverstatus:: shardingStatistics.countIncrementalRefreshesStarted
1341+
1342+
The cumulative number of incremental refreshes that have started.
1343+
1344+
.. serverstatus:: shardingStatistics.catalogCache.numActiveFullRefreshes
1345+
1346+
The number of full catalog cache refreshes that are currently
1347+
waiting to complete.
1348+
1349+
.. serverstatus:: shardingStatistics.catalogCache.countFullRefreshesStarted
1350+
1351+
The cumulative number of full refreshes that have started.
1352+
1353+
.. serverstatus:: shardingStatistics.catalogCache.countFailedRefreshes
1354+
1355+
The cumulative number of full or incremental refreshes that have failed.
1356+
12211357
.. _server-status-storage-engine:
12221358

12231359
storageEngine

source/reference/method/db.serverStatus.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ db.serverStatus()
1515
Returns a :term:`document` that provides an overview of the
1616
database process's state.
1717

18-
.. include:: /includes/extracts/serverStatus-method-output-change-v3.0.rst
18+
.. include:: /includes/extracts/serverStatus-method-output-change.rst
1919

2020
This command provides a wrapper around the database command
2121
:dbcommand:`serverStatus`.

source/release-notes/4.0.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,11 @@ Commands
413413
- ``nameOnly`` to return only the collection names and types (which
414414
does not require collection locks).
415415

416+
- The command :dbcommand:`serverStatus` and the :binary:`~bin.mongo`
417+
shell helper :method:`db.serverStatus()` includes
418+
:serverstatus:`shardingStatistics` in its output. The
419+
:serverstatus:`shardingStatistics` includes data on metadata refresh
420+
on sharded clusters.
416421

417422
Network Layer Improvements
418423
~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -425,7 +430,6 @@ Network Layer Improvements
425430
:binary:`~bin.mongos` when using a single :parameter:`Task Executor
426431
connection pool <taskExecutorPoolSize>`.
427432

428-
429433
Changes Affecting Compatibility
430434
-------------------------------
431435

0 commit comments

Comments
 (0)