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

rs.printSlaveReplicationInfo() may show negative values if executed from a secondary

    • 0.5

      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.

            Assignee:
            jeffrey.allen@mongodb.com Jeffrey Allen
            Reporter:
            kelsey.schubert@mongodb.com Kelsey Schubert
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              6 years, 8 weeks, 2 days ago