[DOCS-4368] rs.printReplicationInfo() performs the same way on primary and secondary Created: 14/Nov/14  Updated: 13/Nov/23  Resolved: 18/Feb/15

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.18, mongodb-2.6, mongodb-3.0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Bug Priority: Major - P3
Reporter: Joanna Cheng Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 9 years ago

 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)



 Comments   
Comment by Githook User [ 18/Feb/15 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-4368 fix get/printReplicationInfo descriptions
Branch: master
https://github.com/mongodb/docs/commit/e76db3b8607bb930860e19301c88fd9fe81c025e

Comment by Githook User [ 18/Feb/15 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-4368 fix get/printReplicationInfo descriptions
Branch: v2.6
https://github.com/mongodb/docs/commit/168520289f6870a6866bf6f6edb9b50bbf59d63f

Generated at Thu Feb 08 07:47:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.