]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: calculate failed_since relative to message receive time
authorSage Weil <sage@inktank.com>
Thu, 15 Nov 2012 01:00:57 +0000 (17:00 -0800)
committerSage Weil <sage@inktank.com>
Thu, 15 Nov 2012 01:00:57 +0000 (17:00 -0800)
Instead of looking at the current time we process the message, look at the
receive time.  This gives us a more real failure time given that messages
may be requeued.

It doesn't solve the problem when messages are forwarded between monitors
due to an election, but that's ok; this is still a net improvement.

Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/OSDMonitor.cc

index 21ae96806e41cc4f4709fb1b8f0f9f1040417eef..bad579048f24bbdc5478d0c104bf2fd4785116d2 100644 (file)
@@ -768,7 +768,7 @@ bool OSDMonitor::prepare_failure(MOSDFailure *m)
 
   // calculate failure time
   utime_t now = ceph_clock_now(g_ceph_context);
-  utime_t failed_since = now - utime_t(m->failed_for ? m->failed_for : g_conf->osd_heartbeat_grace, 0);
+  utime_t failed_since = m->get_recv_stamp() - utime_t(m->failed_for ? m->failed_for : g_conf->osd_heartbeat_grace, 0);
   
   if (m->if_osd_failed()) {
     // add a report