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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Done
    • 2.4.6
    • 2.5.5
    • Replication
    • None
    • Bug a result of code review
    • ALL

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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: