Skip to content

Commit 4da61d5

Browse files
committed
DOCS-13423: 4.2.2 waitingForLatches currentOp
1 parent 2e8419e commit 4da61d5

File tree

3 files changed

+103
-0
lines changed

3 files changed

+103
-0
lines changed

source/includes/currentOp-output-example.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@
6262
},
6363
"killPending" : <boolean>,
6464
"numYields" : <number>,
65+
"waitingForLatch" : { // Starting in MongoDB 4.2.2
66+
"timestamp" : <ISODate()>,
67+
"captureName" : <string>
68+
},
6569
"locks" : {
6670
"ParallelBatchWriterMode" : <string>,
6771
"ReplicationStateTransition" : <string>,
@@ -195,6 +199,10 @@
195199
},
196200
"killPending" : <boolean>,
197201
"numYields" : <number>,
202+
"waitingForLatch" : { // Starting in MongoDB 4.2.2
203+
"timestamp" : <ISODate()>,
204+
"captureName" : <string>
205+
},
198206
"locks" : {
199207
"ParallelBatchWriterMode" : <string>,
200208
"ReplicationStateTransition" : <string>,
@@ -353,6 +361,10 @@
353361
},
354362
"killPending" : <boolean>,
355363
"numYields" : <number>,
364+
"waitingForLatch" : { // Starting in MongoDB 4.2.2
365+
"timestamp" : <ISODate()>,
366+
"captureName" : <string>
367+
},
356368
"locks" : {
357369
"ParallelBatchWriterMode" : <string>,
358370
"ReplicationStateTransition" : <string>,

source/reference/command/currentOp.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,38 @@ Output Fields
896896

897897
.. include:: /includes/fact-client-appname.rst
898898

899+
.. data:: currentOp.waitingForLatch
900+
901+
The :data:`~currentOp.waitingForLatch` document is only
902+
available if the operation is waiting to acquire an internal locking
903+
primitive (a.k.a. a latch) or for an internal condition to be met.
904+
905+
For example,
906+
907+
.. code-block:: javascript
908+
909+
"waitingForLatch" : {
910+
"timestamp" : ISODate("2020-03-19T23:25:58.412Z"),
911+
"captureName" : "FutureResolution",
912+
},
913+
914+
.. list-table::
915+
:header-rows: 1
916+
:widths: 20 80
917+
918+
* - Output Field
919+
- Description
920+
921+
* - timestamp
922+
923+
- The date and time at which the operation started to wait.
924+
925+
* - captureName
926+
927+
- The internal name of the section where the operation is currently blocked.
928+
929+
.. versionadded:: 4.2.2
930+
899931
.. data:: currentOp.locks
900932

901933
The :data:`~currentOp.locks` document reports the type and mode of

source/reference/operator/aggregation/currentOp.txt

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,26 @@ Syntax
165165

166166
.. versionadded:: 4.0
167167

168+
* - :ref:`backtrace <currentOp-stage-backtrace>`
169+
170+
- .. _currentOp-stage-backtrace:
171+
172+
Boolean. Determines whether callstack information is returned as
173+
part of the :data:`~$currentOp.waitingForLatch` output field.
174+
175+
- If set to ``true``, :pipeline:`$currentOp` includes
176+
:data:`waitingForLatch.backtrace <$currentOp.waitingForLatch>`
177+
field that contains the callstack information, if available.
178+
If unavailable, the field contains an empty array.
179+
180+
- If set to ``false``, :pipeline:`$currentOp` omits the
181+
:data:`waitingForLatch.backtrace <$currentOp.waitingForLatch>`
182+
field.
183+
184+
Defaults to ``false``.
185+
186+
.. versionadded:: 4.2.2
187+
168188
Omitting any of the above parameters will cause $currentOp to use
169189
that parameter's default value. Specify an empty document, as shown
170190
below, to use the default values of all parameters.
@@ -1361,6 +1381,45 @@ relevant for the operation:
13611381
other operations that have data in memory to complete quickly
13621382
while MongoDB reads in data for the yielding operation.
13631383

1384+
1385+
.. data:: $currentOp.waitingForLatch
1386+
1387+
The :data:`~$currentOp.waitingForLatch` document is only
1388+
available if the operation is waiting to acquire an internal locking
1389+
primitive (a.k.a. a latch) or for an internal condition to be met.
1390+
1391+
For example,
1392+
1393+
.. code-block:: javascript
1394+
1395+
"waitingForLatch" : {
1396+
"timestamp" : ISODate("2020-03-19T23:25:58.412Z"),
1397+
"captureName" : "FutureResolution",
1398+
"backtrace" : [ ] // Only if backtrace: true
1399+
},
1400+
1401+
.. list-table::
1402+
:header-rows: 1
1403+
:widths: 20 80
1404+
1405+
* - Output Field
1406+
- Description
1407+
1408+
* - timestamp
1409+
1410+
- The date and time at which the operation started to wait.
1411+
1412+
* - captureName
1413+
1414+
- The internal name of the section where the operation is currently blocked.
1415+
1416+
* - backtrace
1417+
1418+
- The callstack, if available. The field is only included if
1419+
:ref:`backtrace: true <currentOp-stage-backtrace>`.
1420+
1421+
.. versionadded:: 4.2.2
1422+
13641423
.. data:: $currentOp.locks
13651424

13661425
The :data:`~$currentOp.locks` document reports the type and mode of

0 commit comments

Comments
 (0)