Skip to content

Commit 448ad32

Browse files
(DOCS-14924): created date included in mongos output (#159)
* (DOCS-14924): created date included in mongos output * updates per copy review * remove extra space * remove extra space * edit example output * updates per copy review * fix table format * change 'ping' data type * single source table * milliseconds > seconds
1 parent b697072 commit 448ad32

File tree

4 files changed

+94
-37
lines changed

4 files changed

+94
-37
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.. list-table::
2+
:header-rows: 1
3+
:stub-columns: 1
4+
:widths: 10 10 20
5+
6+
* - Field
7+
- Data Type
8+
- Description
9+
10+
* - ``_id``
11+
- String
12+
- The hostname and port where the
13+
:binary:`~bin.mongos` is running. The ``_id`` is formatted as
14+
``<hostname>:<port>``.
15+
16+
* - ``advisoryHostFQDNs``
17+
- Array of strings
18+
- Array of the :binary:`~bin.mongos`'s fully qualified domain
19+
names (FQDNs).
20+
21+
* - ``created``
22+
- Date
23+
- When the :binary:`~bin.mongos` was started.
24+
25+
.. versionadded:: 5.2
26+
27+
* - ``mongoVersion``
28+
- String
29+
- Version of MongoDB that the :binary:`~bin.mongos` is running.
30+
31+
* - ``ping``
32+
- Date
33+
- :binary:`~bin.mongos` instances send pings to the
34+
:ref:`config server <sharding-config-server>` every 30
35+
seconds. This field indicates the last ping time.
36+
37+
* - ``up``
38+
- NumberLong
39+
- Number of seconds the :binary:`~bin.mongos` has been up as of
40+
the last ping.
41+
42+
* - ``waiting``
43+
- Boolean
44+
- As of MongoDB 3.4, this field is always ``true`` and is
45+
only present for backward compatibility.

source/reference/config-database.txt

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ Config Database
1414

1515
The collections in the ``config`` database support:
1616

17-
- :doc:`sharded cluster operations </sharding>`, and
17+
- :doc:`Sharded cluster operations </sharding>`
1818

19-
- starting in MongoDB 3.6, :ref:`causally consistent sessions
20-
<sessions>` for standalones, replica sets, and sharded clusters and
21-
retryable writes for replica sets and sharded clusters.
19+
- :ref:`Causally consistent sessions <sessions>` for standalones,
20+
replica sets, and sharded clusters and retryable writes for replica
21+
sets and sharded clusters.
2222

2323
Restrictions
2424
------------
@@ -333,29 +333,30 @@ to support sharding:
333333
.. include:: /includes/admonition-config-db-is-internal.rst
334334

335335
The :data:`~config.mongos` collection stores a document for each
336-
:binary:`~bin.mongos` instance affiliated with the
337-
cluster. :binary:`~bin.mongos` instances send pings to all members of
338-
the cluster every 30 seconds so the cluster can verify that the
339-
:binary:`~bin.mongos` is active. The ``ping`` field shows the time of
340-
the last ping, while the ``up`` field reports the uptime of the
341-
:binary:`~bin.mongos` as of the last ping. The cluster maintains this
342-
collection for reporting purposes.
336+
:binary:`~bin.mongos` instance affiliated with the cluster. The
337+
cluster maintains this collection for reporting purposes.
338+
339+
Each document in the :data:`~config.mongos` collection contains these
340+
fields:
341+
342+
.. include:: /includes/table-mongos-output-fields.rst
343343

344344
The following document shows the status of the :binary:`~bin.mongos`
345345
running on ``example.com:27017``.
346346

347347
.. code-block:: javascript
348348

349-
{
350-
"_id" : "example.com:27017",
351-
"advisoryHostFQDNs" : [
352-
"example.com"
353-
],
354-
"mongoVersion" : "4.2.0",
355-
"ping" : ISODate("2019-09-25T19:26:52.360Z"),
356-
"up" : NumberLong(50),
357-
"waiting" : true
358-
}
349+
[
350+
{
351+
_id: 'example.com:27017',
352+
advisoryHostFQDNs: [ "example.com" ],
353+
created: ISODate("2021-11-22T16:32:13.708Z"),
354+
mongoVersion: "5.2.0",
355+
ping: ISODate("2021-12-15T22:09:23.161Z"),
356+
up: Long("2007429"),
357+
waiting: true
358+
}
359+
]
359360

360361
.. data:: config.rangeDeletions
361362

source/reference/method/sh.status.txt

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -209,34 +209,32 @@ Sharding Version
209209
Active ``mongos`` Instances
210210
~~~~~~~~~~~~~~~~~~~~~~~~~~~
211211

212-
.. versionadded:: 3.2
213-
214212
.. data:: sh.status.active-mongoses
215213

216214
If ``verbose`` is ``false``, :data:`sh.status.active-mongoses` lists
217215
the version and count of the active :binary:`~bin.mongos` instances.
218216
Active :binary:`~bin.mongos` instances are :binary:`~bin.mongos`
219-
instances that have been ping'ed within the last 60 seconds.
217+
instances that have been pinged within the last 60 seconds.
220218

221-
If ``verbose`` is ``true``, returns for each active :binary:`~bin.mongos` instance:
222-
223-
- Its hostname and port.
224-
225-
- An array of the instance's fully qualified domain names (FQDNs).
226-
227-
- Its MongoDB version.
228-
229-
- Its most recent ping date and time.
230-
231-
- Its uptime since the last ping.
219+
If ``verbose`` is ``true``, :data:`sh.status.active-mongoses` returns
220+
a document for each active :binary:`~bin.mongos` instance containing
221+
the following fields:
232222

233-
- Its waiting status.
223+
.. include:: /includes/table-mongos-output-fields.rst
234224

235225
.. code-block:: javascript
236226

237227
active mongoses:
238228

239-
{ "_id" : "<hostname:port>", "advisoryHostFQDNs" : [ "<name>" ], "mongoVersion" : <string>, "ping" : <ISODate>, "up" : <long>, "waiting" : <boolean> }
229+
{
230+
"_id" : "<hostname:port>",
231+
"advisoryHostFQDNs" : [ "<name>" ],
232+
"created" : <ISODate>,
233+
"mongoVersion" : <string>,
234+
"ping" : <ISODate>,
235+
"up" : <long>,
236+
"waiting" : <boolean>
237+
}
240238
...
241239

242240
.. _autosplit-status:

source/release-notes/5.2.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ MongoDB 5.2 introduces the following aggregation operators:
4545
* - :expression:`$sortArray`
4646
- Sorts an array based on its elements.
4747

48+
.. _5.2-rel-notes-sharding:
49+
50+
Sharding
51+
--------
52+
53+
Starting in MongoDB 5.2, the time that a :binary:`~bin.mongos` was
54+
started is included in the:
55+
56+
- Output of the :method:`sh.status()` method (when ``verbose`` is set
57+
to ``true``)
58+
59+
- :data:`config.mongos` collection
60+
4861
.. _5.2-rel-notes-general:
4962

5063
General Improvements

0 commit comments

Comments
 (0)