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

Replica set lastHeartbeat documentation is incorrect

    XMLWordPrintableJSON

Details

    Description

      The manual at https://docs.mongodb.org/manual/reference/command/replSetGetStatus/#replSetGetStatus.members[n].lastHeartbeat states that:

      The lastHeartbeat value provides an ISODate formatted date and time of the transmission time of last heartbeat received from this member. Compare this value to the value of the date and lastHeartBeatRecv field to track latency between these members.

      If there are two nodes A and B and we are at node A, my understanding of this sentence is:

      • lastHeartbeat means the timestamp when the heartbeat was sent from B to A
      • lastHeartbeatRecv means the timestamp when B's heartbeat reply was received by A

      However this is incorrect, as my testing seems to show that lastHeartbeat keeps increasing in value and seems to track the current time, while lastHeartbeatRecv is showing the time node B replies to the heartbeat request from A.

      Therefore, the manual is incorrect: lastHeartbeat is apparently the timestamp when node A sends a heartbeat to node B.

      Note: The source code in src/mongo/db/repl/member_heartbeat_data.h also shows an incorrect comment.

      Attachments

        Activity

          People

            nick.larew@mongodb.com Nicholas Larew
            kevin.adistambha@mongodb.com Kevin Adistambha
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

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