-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: manual
-
Labels:
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.
- backports
-
SERVER-50038 [mongostat] difference between pingMs and heartbeat parameters(lastHeartbeat & lastHeartbeatRecv)
- Closed
- is duplicated by
-
DOCS-10879 Description of lastHeartbeat and lastHeartbeatRecv is incorrect
- Closed