Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-11280

ReplSetHealthPollTask::down uses m.lastHeartbeatRecv, which is not properly set

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.5.5
    • Affects Version/s: 2.4.6
    • Component/s: Replication
    • None
    • Environment:
      Bug a result of code review
    • ALL

      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;
                  }
      

            Assignee:
            matt.dannenberg Matt Dannenberg
            Reporter:
            zardosht Zardosht Kasheff
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: