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

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

      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)

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

              Created:
              Updated:
              Resolved:
              9 years, 11 weeks, 1 day ago