Skip to content

Commit fc942ad

Browse files
npentreljeff-allen-mongo
authored andcommitted
DOCS-14197 currentOp for ReshardingCoordinatorSvc
1 parent 1eaa659 commit fc942ad

File tree

3 files changed

+250
-0
lines changed

3 files changed

+250
-0
lines changed

source/reference/command/currentOp.txt

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,3 +1114,123 @@ Output Fields
11141114

11151115
.. versionadded:: 4.2
11161116

1117+
.. data:: currentOp.totalOperationTimeElapsed
1118+
1119+
The total time elapsed, in seconds, for the current resharding
1120+
operation. The time is set to 0 when a new resharding operation
1121+
starts.
1122+
1123+
Only present if a resharding operation is taking place.
1124+
1125+
.. versionadded:: 5.0
1126+
1127+
.. data:: currentOp.remainingOperationTimeEstimated
1128+
1129+
The estimated time remaining in seconds for the current resharding
1130+
operation. The time is set to -1 when a new resharding operation
1131+
starts.
1132+
1133+
Only present when a resharding operation is taking place.
1134+
1135+
.. versionadded:: 5.0
1136+
1137+
.. data:: currentOp.coordinatorState
1138+
1139+
The state of the resharding coordinator for the current resharding
1140+
operation. The resharding coordinator is an operation that runs on
1141+
the :doc:`config server </core/sharded-cluster-config-servers>`
1142+
primary. The state is set to ``unused`` when a new resharding
1143+
operation starts.
1144+
1145+
Only present on the coordinating config server.
1146+
1147+
.. list-table::
1148+
:widths: 20 80
1149+
:header-rows: 1
1150+
1151+
* - State
1152+
- Description
1153+
1154+
* - ``unused``
1155+
- The resharding operation is about to start.
1156+
1157+
* - ``initializing``
1158+
- The resharding coordinator has inserted the coordinator
1159+
document into ``config.reshardingOperations`` and has added
1160+
the ``reshardingFields`` to the ``config.collections`` entry
1161+
for the original collection.
1162+
1163+
* - ``preparing-to-donate``
1164+
- The resharding coordinator
1165+
1166+
- has created a ``config.collections`` entry for the temporary
1167+
resharding collection.
1168+
- has inserted entries into ``config.chunks`` for ranges based
1169+
on the new shard key.
1170+
- has inserted entries into ``config.tags`` for any zones
1171+
associated with the new shard key.
1172+
1173+
The coordinator informs participants shards to begin the
1174+
resharding operation. The coordinator then waits until all
1175+
donor shards have picked a ``minFetchTimestamp`` and are ready
1176+
to donate.
1177+
1178+
* - ``cloning``
1179+
- The resharding coordinator informs donor shards to donate data
1180+
to recipient shards. The coordinator waits for all recipients
1181+
to finish cloning the data from the donor.
1182+
1183+
* - ``applying``
1184+
- The resharding coordinator informs recipient shards to modify
1185+
their copies of data based on new incoming writes from donor
1186+
shards. The coordinator waits for all recipients to finish
1187+
applying :term:`oplog` entries.
1188+
1189+
* - ``mirroring``
1190+
- The resharding coordinator informs donor shards to prevent new
1191+
incoming write operations to the collection being resharded.
1192+
The coordinator then waits for all recipients to have all data
1193+
changes.
1194+
1195+
* - ``decision-persisted``
1196+
- The resharding coordinator removes the ``config.collections``
1197+
entry for the temporary resharding collection. The coordinator
1198+
then adds the ``recipientFields`` to the source collection's
1199+
entry.
1200+
1201+
* - ``done``
1202+
- The resharding operation is complete.
1203+
1204+
* - ``error``
1205+
- An error occurred during the resharding operation.
1206+
1207+
.. versionadded:: 5.0
1208+
1209+
.. data:: currentOp.opStatus
1210+
1211+
The current state of a resharding operation.
1212+
1213+
Only present if a resharding operation is taking place. Once the
1214+
operation has completed, the operation is removed from ``currentOp``
1215+
output.
1216+
1217+
.. list-table::
1218+
:widths: 20 80
1219+
:header-rows: 1
1220+
1221+
* - State
1222+
- Description
1223+
1224+
* - ``actively running``
1225+
- The resharding operation is actively running.
1226+
1227+
* - ``success``
1228+
- The resharding operation has succeeded.
1229+
1230+
* - ``failure``
1231+
- The resharding operation has failed.
1232+
1233+
* - ``canceled``
1234+
- The resharding operation was canceled.
1235+
1236+
.. versionadded:: 5.0

source/reference/operator/aggregation/currentOp.txt

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,3 +1570,124 @@ relevant for the operation:
15701570
The total time this operation has waited to acquire a ticket.
15711571

15721572
.. versionadded:: 4.2
1573+
1574+
.. data:: $currentOp.totalOperationTimeElapsed
1575+
1576+
The total time elapsed, in seconds, for the current resharding
1577+
operation. The time is set to 0 when a new resharding operation
1578+
starts.
1579+
1580+
Only present if a resharding operation is taking place.
1581+
1582+
.. versionadded:: 5.0
1583+
1584+
.. data:: $currentOp.remainingOperationTimeEstimated
1585+
1586+
The estimated time remaining in seconds for the current resharding
1587+
operation. The time is set to -1 when a new resharding operation
1588+
starts.
1589+
1590+
Only present when a resharding operation is taking place.
1591+
1592+
.. versionadded:: 5.0
1593+
1594+
.. data:: $currentOp.coordinatorState
1595+
1596+
The state of the resharding coordinator for the current resharding
1597+
operation. The resharding coordinator is an operation that runs on
1598+
the :doc:`config server </core/sharded-cluster-config-servers>`
1599+
primary. The state is set to ``unused`` when a new resharding
1600+
operation starts.
1601+
1602+
Only present on the coordinating config server.
1603+
1604+
.. list-table::
1605+
:widths: 20 80
1606+
:header-rows: 1
1607+
1608+
* - State
1609+
- Description
1610+
1611+
* - ``unused``
1612+
- The resharding operation is about to start.
1613+
1614+
* - ``initializing``
1615+
- The resharding coordinator has inserted the coordinator
1616+
document into ``config.reshardingOperations`` and has added
1617+
the ``reshardingFields`` to the ``config.collections`` entry
1618+
for the original collection.
1619+
1620+
* - ``preparing-to-donate``
1621+
- The resharding coordinator
1622+
1623+
- has created a ``config.collections`` entry for the temporary
1624+
resharding collection.
1625+
- has inserted entries into ``config.chunks`` for ranges based
1626+
on the new shard key.
1627+
- has inserted entries into ``config.tags`` for any zones
1628+
associated with the new shard key.
1629+
1630+
The coordinator informs participants shards to begin the
1631+
resharding operation. The coordinator then waits until all
1632+
donor shards have picked a ``minFetchTimestamp`` and are ready
1633+
to donate.
1634+
1635+
* - ``cloning``
1636+
- The resharding coordinator informs donor shards to donate data
1637+
to recipient shards. The coordinator waits for all recipients
1638+
to finish cloning the data from the donor.
1639+
1640+
* - ``applying``
1641+
- The resharding coordinator informs recipient shards to modify
1642+
their copies of data based on new incoming writes from donor
1643+
shards. The coordinator waits for all recipients to finish
1644+
applying :term:`oplog` entries.
1645+
1646+
* - ``mirroring``
1647+
- The resharding coordinator informs donor shards to prevent new
1648+
incoming write operations to the collection being resharded.
1649+
The coordinator then waits for all recipients to have all data
1650+
changes.
1651+
1652+
* - ``decision-persisted``
1653+
- The resharding coordinator removes the ``config.collections``
1654+
entry for the temporary resharding collection. The coordinator
1655+
then adds the ``recipientFields`` to the source collection's
1656+
entry.
1657+
1658+
* - ``done``
1659+
- The resharding operation is complete.
1660+
1661+
* - ``error``
1662+
- An error occurred during the resharding operation.
1663+
1664+
.. versionadded:: 5.0
1665+
1666+
.. data:: $currentOp.opStatus
1667+
1668+
The current state of a resharding operation.
1669+
1670+
Only present if a resharding operation is taking place. Once the
1671+
operation has completed, the operation is removed from ``currentOp``
1672+
output.
1673+
1674+
.. list-table::
1675+
:widths: 20 80
1676+
:header-rows: 1
1677+
1678+
* - State
1679+
- Description
1680+
1681+
* - ``actively running``
1682+
- The resharding operation is actively running.
1683+
1684+
* - ``success``
1685+
- The resharding operation has succeeded.
1686+
1687+
* - ``failure``
1688+
- The resharding operation has failed.
1689+
1690+
* - ``canceled``
1691+
- The resharding operation was canceled.
1692+
1693+
.. versionadded:: 5.0

source/release-notes/5.0.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,15 @@ output:
327327
| :serverstatus:`metrics.cursor.totalOpened`, which reports
328328
the total number of cursors that have been opened
329329

330+
``currentOp`` Output Change
331+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
332+
333+
Starting in MongoDB 5.0, the :pipeline:`$currentOp` aggregation stage
334+
(and the :dbcommand:`currentOp` command and :method:`db.currentOp()`
335+
shell method) include additional information about the status of ongoing
336+
resharding operations for the resharding coordinator and the
337+
donor and recipient shards.
338+
330339
Additional ``dbStats`` Free Space Statistics
331340
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
332341

0 commit comments

Comments
 (0)