[DOCS-10359] rs.printSlaveReplicationInfo() may show negative values if executed from a secondary Created: 06/Jun/17  Updated: 30/Oct/23  Resolved: 27/Feb/18

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Major - P3
Reporter: Kelsey Schubert Assignee: Jeffrey Allen
Resolution: Fixed Votes: 0
Labels: heartbeat, replica-set
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

https://docs.mongodb.com/manual/reference/method/rs.printSlaveReplicationInfo/


Issue Links:
Documented
documents SERVER-34379 Primary is -1 Sec behind the primary Closed
Participants:
Days since reply: 5 years, 49 weeks, 2 days ago
Story Points: 0.5

 Description   

There are expected situations where rs.printSlaveReplicationInfo() may return negative values. For example, consider a sequence is something like this:
12:00:00.00 Primary writes a no-op
12:01:00.00 Heartbeat updates secondary's view of primary – every 2s, I won't list them all
12:00:00.10 Secondary replicates no-op (nice fast system)
12:05:00.00 Primary takes a real write
12:05:00.10 Secondary replicates real write
12:10:00.00 Nothing, no-op is skipped
12:19:00.00 Heartbeat, secondary sees primary op time of 12:05:00
12:20:00.00 Primary writes a no-op
12:20:00.10 Secondary replicates no-op
— any replication status in here will get a -15s lag —
12:21:00.00 Heartbeat, secondary sees primary op time of 12:20:00

We should clarify that the lag reported by secondaries may not be representative of the cluster health (i.e. negative values do not indicate that the secondary is ahead of the primary). Additionally, we should clarify that it's generally advisable to run rs.printSlaveReplicationInfo() on the primary.



 Comments   
Comment by Githook User [ 05/Mar/18 ]

Author:

{'email': 'jeffrey.allen@10gen.com', 'name': 'jeff-allen-mongo', 'username': 'jeff-allen-mongo'}

Message: DOCS-10359 - Adding point about negative values for printSlaveReplicationInfo()
Branch: master
https://github.com/mongodb/docs/commit/64f7c0ed9afabd8ce94e670160801162876b78cc

Comment by Jeffrey Allen [ 27/Feb/18 ]

This is RFM: https://github.com/mongodb/docs/pull/3247

Comment by Jeffrey Allen [ 15/Feb/18 ]

Code review: https://mongodbcr.appspot.com/190170002/

Generated at Thu Feb 08 08:00:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.