From c710c4c5b516b5cea00c40b7be5dbf30cdcb9907 Mon Sep 17 00:00:00 2001 From: Jason Price Date: Tue, 2 Mar 2021 15:18:06 -0800 Subject: [PATCH] DOCS-14213 printSecondaryReplicationInfo not documented --- .tx/config | 10 ++++++ ...eprecated-db.printSlaveReplicationInfo.rst | 2 ++ ...eprecated-rs.printSlaveReplicationInfo.rst | 2 ++ .../note-method-does-not-return-json.rst | 4 +-- .../output-printSecondaryReplicationInfo.rst | 32 +++++++++++++++++++ source/reference/method.txt | 17 ++++++++-- .../db.printSecondaryReplicationInfo.txt | 28 ++++++++++++++++ .../method/db.printSlaveReplicationInfo.txt | 2 ++ source/reference/method/js-database.txt | 11 +++++-- source/reference/method/js-replication.txt | 11 +++++-- .../rs.printSecondaryReplicationInfo.txt | 28 ++++++++++++++++ .../method/rs.printSlaveReplicationInfo.txt | 2 ++ source/reference/replication.txt | 10 ++++-- source/tutorial/troubleshoot-replica-sets.txt | 2 +- 14 files changed, 149 insertions(+), 12 deletions(-) create mode 100644 source/includes/deprecated-db.printSlaveReplicationInfo.rst create mode 100644 source/includes/deprecated-rs.printSlaveReplicationInfo.rst create mode 100644 source/includes/output-printSecondaryReplicationInfo.rst create mode 100644 source/reference/method/db.printSecondaryReplicationInfo.txt create mode 100644 source/reference/method/rs.printSecondaryReplicationInfo.txt diff --git a/.tx/config b/.tx/config index 21e162d7512..5dff99a06af 100644 --- a/.tx/config +++ b/.tx/config @@ -3252,6 +3252,11 @@ file_filter = locale//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//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//LC_MESSAGES/reference/method/db.printSlaveReplicationInfo.po source_file = locale/pot/reference/method/db.printSlaveReplicationInfo.pot @@ -4087,6 +4092,11 @@ file_filter = locale//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//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//LC_MESSAGES/reference/method/rs.printSlaveReplicationInfo.po source_file = locale/pot/reference/method/rs.printSlaveReplicationInfo.pot diff --git a/source/includes/deprecated-db.printSlaveReplicationInfo.rst b/source/includes/deprecated-db.printSlaveReplicationInfo.rst new file mode 100644 index 00000000000..f83db8c4ce6 --- /dev/null +++ b/source/includes/deprecated-db.printSlaveReplicationInfo.rst @@ -0,0 +1,2 @@ +*Deprecated since version 3.6.21:* Use +:method:`db.printSecondaryReplicationInfo()` instead. \ No newline at end of file diff --git a/source/includes/deprecated-rs.printSlaveReplicationInfo.rst b/source/includes/deprecated-rs.printSlaveReplicationInfo.rst new file mode 100644 index 00000000000..9ac33499c2e --- /dev/null +++ b/source/includes/deprecated-rs.printSlaveReplicationInfo.rst @@ -0,0 +1,2 @@ +*Deprecated since version 3.6.21:* Use +:method:`rs.printSecondaryReplicationInfo()` instead. \ No newline at end of file diff --git a/source/includes/note-method-does-not-return-json.rst b/source/includes/note-method-does-not-return-json.rst index 065ba745cf6..137316a26e1 100644 --- a/source/includes/note-method-does-not-return-json.rst +++ b/source/includes/note-method-does-not-return-json.rst @@ -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. diff --git a/source/includes/output-printSecondaryReplicationInfo.rst b/source/includes/output-printSecondaryReplicationInfo.rst new file mode 100644 index 00000000000..f1b25a4ec96 --- /dev/null +++ b/source/includes/output-printSecondaryReplicationInfo.rst @@ -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 ` 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 +`. + +.. 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. diff --git a/source/reference/method.txt b/source/reference/method.txt index 0a02b13ef48..05612216ae7 100644 --- a/source/reference/method.txt +++ b/source/reference/method.txt @@ -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()` @@ -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()` diff --git a/source/reference/method/db.printSecondaryReplicationInfo.txt b/source/reference/method/db.printSecondaryReplicationInfo.txt new file mode 100644 index 00000000000..f15413b1422 --- /dev/null +++ b/source/reference/method/db.printSecondaryReplicationInfo.txt @@ -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 diff --git a/source/reference/method/db.printSlaveReplicationInfo.txt b/source/reference/method/db.printSlaveReplicationInfo.txt index 6a298d743ed..7c656a5e034 100644 --- a/source/reference/method/db.printSlaveReplicationInfo.txt +++ b/source/reference/method/db.printSlaveReplicationInfo.txt @@ -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 diff --git a/source/reference/method/js-database.txt b/source/reference/method/js-database.txt index 71685e6f3eb..88e685ab979 100644 --- a/source/reference/method/js-database.txt +++ b/source/reference/method/js-database.txt @@ -154,7 +154,13 @@ 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()` @@ -162,7 +168,7 @@ Database Methods * - :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()` @@ -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 diff --git a/source/reference/method/js-replication.txt b/source/reference/method/js-replication.txt index 14fcb213e9c..d5770372b1e 100644 --- a/source/reference/method/js-replication.txt +++ b/source/reference/method/js-replication.txt @@ -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()` @@ -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 diff --git a/source/reference/method/rs.printSecondaryReplicationInfo.txt b/source/reference/method/rs.printSecondaryReplicationInfo.txt new file mode 100644 index 00000000000..68b91296963 --- /dev/null +++ b/source/reference/method/rs.printSecondaryReplicationInfo.txt @@ -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 diff --git a/source/reference/method/rs.printSlaveReplicationInfo.txt b/source/reference/method/rs.printSlaveReplicationInfo.txt index 6e554a5c1f9..1b2beca10ec 100644 --- a/source/reference/method/rs.printSlaveReplicationInfo.txt +++ b/source/reference/method/rs.printSlaveReplicationInfo.txt @@ -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 diff --git a/source/reference/replication.txt b/source/reference/replication.txt index 3f80766a930..a2277ec985a 100644 --- a/source/reference/replication.txt +++ b/source/reference/replication.txt @@ -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()` diff --git a/source/tutorial/troubleshoot-replica-sets.txt b/source/tutorial/troubleshoot-replica-sets.txt index 96cb8814b0b..596b5da3a57 100644 --- a/source/tutorial/troubleshoot-replica-sets.txt +++ b/source/tutorial/troubleshoot-replica-sets.txt @@ -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