Skip to content

DOCS-14213 printSecondaryReplicationInfo not documented #5059

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
Mar 4, 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
10 changes: 10 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -3252,6 +3252,11 @@ file_filter = locale/<lang>/LC_MESSAGES/reference/method/db.cloneCollection.po
source_file = locale/pot/reference/method/db.cloneCollection.pot
source_lang = en

[mongodb-manual.reference--method--db_printSecondaryReplicationInfo]
file_filter = locale/<lang>/LC_MESSAGES/reference/method/db.printSecondaryReplicationInfo.po
source_file = locale/pot/reference/method/db.printSecondaryReplicationInfo.pot
source_lang = en

[mongodb-manual.reference--method--db_printSlaveReplicationInfo]
file_filter = locale/<lang>/LC_MESSAGES/reference/method/db.printSlaveReplicationInfo.po
source_file = locale/pot/reference/method/db.printSlaveReplicationInfo.pot
Expand Down Expand Up @@ -4087,6 +4092,11 @@ file_filter = locale/<lang>/LC_MESSAGES/reference/method/db.collection.copyTo.po
source_file = locale/pot/reference/method/db.collection.copyTo.pot
source_lang = en

[mongodb-manual.reference--method--rs_printSecondaryReplicationInfo]
file_filter = locale/<lang>/LC_MESSAGES/reference/method/rs.printSecondaryReplicationInfo.po
source_file = locale/pot/reference/method/rs.printSecondaryReplicationInfo.pot
source_lang = en

[mongodb-manual.reference--method--rs_printSlaveReplicationInfo]
file_filter = locale/<lang>/LC_MESSAGES/reference/method/rs.printSlaveReplicationInfo.po
source_file = locale/pot/reference/method/rs.printSlaveReplicationInfo.pot
Expand Down
2 changes: 2 additions & 0 deletions source/includes/deprecated-db.printSlaveReplicationInfo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*Deprecated since version 3.6.21:* Use
:method:`db.printSecondaryReplicationInfo()` instead.
2 changes: 2 additions & 0 deletions source/includes/deprecated-rs.printSlaveReplicationInfo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*Deprecated since version 3.6.21:* Use
:method:`rs.printSecondaryReplicationInfo()` instead.
4 changes: 2 additions & 2 deletions source/includes/note-method-does-not-return-json.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. note::

The |method| in the :binary:`~bin.mongo` shell does **not** return
:term:`JSON`. Use |method| for manual inspection, and
The |method| method run in the :binary:`~bin.mongo` shell does
**not** return :term:`JSON`. Use |method| for manual inspection, and
|method-alternative| in scripts.
32 changes: 32 additions & 0 deletions source/includes/output-printSecondaryReplicationInfo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Example |method| output when run on a replica set with two secondary
members:

.. code-block:: javascript

source: m1.example.net:27002
syncedTo: Mon Mar 01 2021 16:30:50 GMT-0800 (PST)
0 secs (0 hrs) behind the primary
source: m2.example.net:27003
syncedTo: Mon Mar 01 2021 16:30:50 GMT-0800 (PST)
0 secs (0 hrs) behind the primary

.. include:: /includes/note-method-does-not-return-json.rst

A :ref:`delayed member <replica-set-delayed-members>` may show as ``0``
seconds behind the primary when the inactivity period on the primary is
greater than the :rsconf:`members[n].slaveDelay` value.

A member may show a negative time value behind the primary when |method|
is run. This is expected if |method| is run after a secondary replicates
a write that follows a period of inactivity, but before the secondary
receives a heartbeat from the primary with the latest :term:`optime
<optime>`.

.. note::

The lag reported by secondaries may not be representative of cluster
health. Negative values do not indicate that the secondary is ahead
of the primary.

To obtain the most current status for your replica set, run |method|
on the primary.
17 changes: 14 additions & 3 deletions source/reference/method.txt
Original file line number Diff line number Diff line change
Expand Up @@ -523,13 +523,18 @@ Database

- Prints a report of the status of the replica set from the perspective of the primary.

* - :method:`db.printSecondaryReplicationInfo()`

- Prints the status of the replica set from the
perspective of the secondaries.

* - :method:`db.printShardingStatus()`

- Prints a report of the sharding configuration and the chunk ranges.

* - :method:`db.printSlaveReplicationInfo()`

- Prints a report of the status of the replica set from the perspective of the secondaries.
- .. include:: /includes/deprecated-db.printSlaveReplicationInfo.rst

* - :method:`db.repairDatabase()`

Expand Down Expand Up @@ -925,11 +930,17 @@ Replication

* - :method:`rs.printReplicationInfo()`

- Prints a report of the status of the replica set from the perspective of the primary.
- Prints a formatted report of the replica set status from the
perspective of the primary.

* - :method:`rs.printSecondaryReplicationInfo()`

- Prints a formatted report of the replica set status from the
perspective of the secondaries.

* - :method:`rs.printSlaveReplicationInfo()`

- Prints a report of the status of the replica set from the perspective of the secondaries.
- .. include:: /includes/deprecated-rs.printSlaveReplicationInfo.rst

* - :method:`rs.reconfig()`

Expand Down
28 changes: 28 additions & 0 deletions source/reference/method/db.printSecondaryReplicationInfo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
==================================
db.printSecondaryReplicationInfo()
==================================

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol

Definition
----------

.. method:: db.printSecondaryReplicationInfo()

Prints a formatted report of the :term:`replica set` status from the
perspective of the :term:`secondary` member of the set. The output is
identical to the :method:`rs.printSecondaryReplicationInfo()` method.

Output
------

.. |method| replace:: :method:`db.printSecondaryReplicationInfo()`
.. |method-alternative| replace:: :method:`rs.status()`

.. include:: /includes/output-printSecondaryReplicationInfo.rst
2 changes: 2 additions & 0 deletions source/reference/method/db.printSlaveReplicationInfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Definition

.. method:: db.printSlaveReplicationInfo()

.. include:: /includes/deprecated-db.printSlaveReplicationInfo.rst

Returns a formatted report of the status of a :term:`replica set`
from the perspective of the :term:`secondary` member of the set. The
output is identical to that of
Expand Down
11 changes: 9 additions & 2 deletions source/reference/method/js-database.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,21 @@ Database Methods

* - :method:`db.printReplicationInfo()`

- Prints a report of the status of the replica set from the perspective of the primary.
- Prints a formatted report of the replica set status from
the perspective of the primary.

* - :method:`db.printSecondaryReplicationInfo()`

- Prints a formatted report of the replica set status from the
perspective of the secondaries.

* - :method:`db.printShardingStatus()`

- Prints a report of the sharding configuration and the chunk ranges.

* - :method:`db.printSlaveReplicationInfo()`

- Prints a report of the status of the replica set from the perspective of the secondaries.
- .. include:: /includes/deprecated-db.printSlaveReplicationInfo.rst

* - :method:`db.repairDatabase()`

Expand Down Expand Up @@ -247,6 +253,7 @@ Database Methods
/reference/method/db.logout
/reference/method/db.printCollectionStats
/reference/method/db.printReplicationInfo
/reference/method/db.printSecondaryReplicationInfo
/reference/method/db.printShardingStatus
/reference/method/db.printSlaveReplicationInfo
/reference/method/db.repairDatabase
Expand Down
11 changes: 9 additions & 2 deletions source/reference/method/js-replication.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,17 @@ Replication Methods

* - :method:`rs.printReplicationInfo()`

- Prints a report of the status of the replica set from the perspective of the primary.
- Prints a formatted report of the replica set status from the
perspective of the primary.

* - :method:`rs.printSecondaryReplicationInfo()`

- Prints a formatted report of the replica set status from the
perspective of the secondaries.

* - :method:`rs.printSlaveReplicationInfo()`

- Prints a report of the status of the replica set from the perspective of the secondaries.
- .. include:: /includes/deprecated-rs.printSlaveReplicationInfo.rst

* - :method:`rs.reconfig()`

Expand Down Expand Up @@ -88,6 +94,7 @@ Replication Methods
/reference/method/rs.help
/reference/method/rs.initiate
/reference/method/rs.printReplicationInfo
/reference/method/rs.printSecondaryReplicationInfo
/reference/method/rs.printSlaveReplicationInfo
/reference/method/rs.reconfig
/reference/method/rs.remove
Expand Down
28 changes: 28 additions & 0 deletions source/reference/method/rs.printSecondaryReplicationInfo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
==================================
rs.printSecondaryReplicationInfo()
==================================

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol

Definition
----------

.. method:: rs.printSecondaryReplicationInfo()

Prints a formatted report of the :term:`replica set` status from the
perspective of the :term:`secondary` member of the set. The output is
identical to :method:`db.printSecondaryReplicationInfo()`.

Output
------

.. |method| replace:: :method:`rs.printSecondaryReplicationInfo()`
.. |method-alternative| replace:: :method:`rs.status()`

.. include:: /includes/output-printSecondaryReplicationInfo.rst
2 changes: 2 additions & 0 deletions source/reference/method/rs.printSlaveReplicationInfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Definition

.. method:: rs.printSlaveReplicationInfo()

.. include:: /includes/deprecated-rs.printSlaveReplicationInfo.rst

Returns a formatted report of the status of a :term:`replica set`
from the perspective of the :term:`secondary` member of the set. The
output is identical to that of
Expand Down
10 changes: 8 additions & 2 deletions source/reference/replication.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@ Replication Methods in the ``mongo`` Shell

* - :method:`rs.printReplicationInfo()`

- Prints a report of the status of the replica set from the perspective of the primary.
- Prints a formatted report of the replica set status from the
perspective of the primary.

* - :method:`rs.printSecondaryReplicationInfo()`

- Prints a formatted report of the replica set status from the
perspective of the secondaries.

* - :method:`rs.printSlaveReplicationInfo()`

- Prints a report of the status of the replica set from the perspective of the secondaries.
- .. include:: /includes/deprecated-rs.printSlaveReplicationInfo.rst

* - :method:`rs.reconfig()`

Expand Down
2 changes: 1 addition & 1 deletion source/tutorial/troubleshoot-replica-sets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ will be inconsistent.
To check the current length of replication lag:

- In a :binary:`~bin.mongo` shell connected to the primary, call the
:method:`rs.printSlaveReplicationInfo()` method.
:method:`rs.printSecondaryReplicationInfo()` method.

Returns the ``syncedTo`` value for each member,
which shows the time when the last oplog entry was written to the
Expand Down