]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: clean up handle_osd_timeouts a bit
authorSage Weil <sage@newdream.net>
Tue, 24 Apr 2012 16:59:34 +0000 (09:59 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Tue, 24 Apr 2012 17:55:22 +0000 (10:55 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/OSDMonitor.cc

index 68ebbd0a7fa0b09b4c8ce66c771f8bd01e3434ba..0cbdcf90580abe527c5837aa75370fa0f0797adf 100644 (file)
@@ -1195,14 +1195,12 @@ void OSDMonitor::handle_osd_timeouts(const utime_t &now,
     const std::map<int,utime_t>::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;
       }