Skip to content

Commit

Permalink
OSDMonitor: calculate failure time only when osd reported failed
Browse files Browse the repository at this point in the history
Signed-off-by: Mingxin Liu <mingxin@xsky.com>
  • Loading branch information
LiumxNL committed Jan 18, 2017
1 parent 29e0b52 commit 0ec21a5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/mon/OSDMonitor.cc
Expand Up @@ -1759,13 +1759,12 @@ bool OSDMonitor::prepare_failure(MonOpRequestRef op)
assert(osdmap.is_up(target_osd));
assert(osdmap.get_addr(target_osd) == m->get_target().addr);

// calculate failure time
utime_t now = ceph_clock_now();
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()) {
// calculate failure time
utime_t now = ceph_clock_now();
utime_t failed_since =
m->get_recv_stamp() - utime_t(m->failed_for, 0);

// add a report
if (m->is_immediate()) {
mon->clog->debug() << m->get_target() << " reported immediately failed by "
Expand Down

0 comments on commit 0ec21a5

Please sign in to comment.