Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-4368

rs.printReplicationInfo() performs the same way on primary and secondary

    XMLWordPrintableJSON

Details

    • 4
    • v1.3.18 - 15 - Ending 2/20
    • true

    Description

      http://docs.mongodb.org/manual/reference/method/rs.printReplicationInfo/

      If run on a secondary, the method calls db.printSlaveReplicationInfo(). See db.printSlaveReplicationInfo() for details.

      But it doesn't

      $ mongo --port 34001
      MongoDB shell version: 2.6.5
      connecting to: 127.0.0.1:34001/test
      replset:SECONDARY> rs.printReplicationInfo()
      configured oplog size:   192MB
      log length start to end: 5890secs (1.64hrs)
      oplog first event time:  Thu Oct 09 2014 13:46:58 GMT+1100 (AEDT)
      oplog last event time:   Thu Oct 09 2014 15:25:08 GMT+1100 (AEDT)
      now:                     Fri Nov 14 2014 16:32:33 GMT+1100 (AEDT)
      replset:SECONDARY> db.printSlaveReplicationInfo()
      source: Joannas-MacBook-Pro.local:34001
      	syncedTo: Thu Oct 09 2014 15:25:08 GMT+1100 (AEDT)
      	0 secs (0 hrs) behind the primary
      source: Joannas-MacBook-Pro.local:34002
      	syncedTo: Thu Oct 09 2014 15:25:08 GMT+1100 (AEDT)
      	0 secs (0 hrs) behind the primary
      replset:SECONDARY>

      Looking at the code, it looks like this is only activated for slaves (i.e. master / slave configurations)

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            joanna.cheng@mongodb.com Joanna Cheng
            Jess Mokrzecki Jess Mokrzecki
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              7 years, 51 weeks, 2 days ago