From: Sage Weil Date: Tue, 24 Apr 2012 16:59:34 +0000 (-0700) Subject: mon: clean up handle_osd_timeouts a bit X-Git-Tag: v0.46~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ccf7d9309eac11ba214dc0e764ca3ee9267de46c;p=ceph.git mon: clean up handle_osd_timeouts a bit Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 68ebbd0a7fa0..0cbdcf90580a 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1195,14 +1195,12 @@ void OSDMonitor::handle_osd_timeouts(const utime_t &now, const std::map::const_iterator t = last_osd_report.find(i); if (t == last_osd_report.end()) { // it wasn't in the map; start the timer. - last_osd_report[i] = ceph_clock_now(g_ceph_context); + last_osd_report[i] = now; } else { - utime_t diff(now); - diff -= t->second; + utime_t diff = now - t->second; if (diff > timeo) { - derr << "OSDMonitor::handle_osd_timeouts: last got MOSDPGStat " - << "info from osd " << i << " at " << t->second << ". It has " - << "been " << diff << ", so we're marking it down!" << dendl; + derr << "no osd or pg stats from osd." << i << " since " << t->second << ", " << diff + << " seconds ago. marking down" << dendl; pending_inc.new_state[i] = CEPH_OSD_UP; new_down = true; }