[SERVER-11280] ReplSetHealthPollTask::down uses m.lastHeartbeatRecv, which is not properly set Created: 19/Oct/13  Updated: 11/Jul/16  Resolved: 04/Dec/13

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 2.4.6
Fix Version/s: 2.5.5

Type: Bug Priority: Minor - P4
Reporter: Zardosht Kasheff Assignee: Matt Dannenberg
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Bug a result of code review


Issue Links:
Related
is related to SERVER-9283 lastHeartbeatRecv flaps between inval... Closed
Operating System: ALL
Participants:

 Description   

The class ReplSetHealthPollTask has a copy of a HeartbeatInfo that it passes to Members upon each heartbeat. This copy's lastHeartbeatRecv value is never updated. Only the copy in the Member's HeartbeatInfo is updated.

Therefore, ReplSetHealthPollTask::m.lastHeartbeatRecv is never accurate.

Basically, the following code in ReplSetHealthPollTask::down is a no-op, because the if-clause will always evaluate to false:

            if (m.lastHeartbeatRecv+2 >= time(0)) {
                log() << "replset info " << h.toString()
                      << " just heartbeated us, but our heartbeat failed: " << msg
                      << ", not changing state" << rsLog;
                // we don't update any of the heartbeat info, though, since we didn't get any info
                // other than "not down" from having it heartbeat us
                return;
            }



 Comments   
Comment by Githook User [ 04/Dec/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-11280 fix detecting downed replica nodes to check against a copy of the member with up to date lastHeartbeatRecv

also pass node id as well as node name in the heartbeat
Branch: master
https://github.com/mongodb/mongo/commit/ec353f534593770eeb9c93fd965d591c73d4b11a

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