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

Replica set lastHeartbeat documentation is incorrect

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: manual
    • Labels:
    • Last comment by Customer:
      true
    • Sprint:
      KANBAN BUCKET

      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

          Issue Links

            Activity

              People

              Assignee:
              nick.larew Nicholas Larew
              Reporter:
              kevin.adistambha Kevin Adistambha
              Participants:
              Last commenter:
              Abolfazl Ziaratban Abolfazl Ziaratban
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                4 years, 8 weeks ago
                Date of 1st Reply: