From: Sage Weil Date: Mon, 27 May 2013 22:24:56 +0000 (-0700) Subject: osd: simplify is_healthy() check during boot X-Git-Tag: v0.65~192^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ea2b2329b3a1ad3a5b5ce316811c75cb75165228;p=ceph.git osd: simplify is_healthy() check during boot This has a slight behavior change in that we ask the mon for the latest osdmap if our internal heartbeat is failing. That isn't useful yet, but will be shortly. Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 8993a1100f5f..26a601ed91a4 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -3052,18 +3052,13 @@ void OSD::_maybe_boot(epoch_t oldest, epoch_t newest) return; } - // if we are not healthy, do not mark ourselves up (yet) - if (!g_ceph_context->get_heartbeat_map()->is_healthy()) { - dout(5) << "not healthy, deferring boot" << dendl; - state = STATE_WAITING_FOR_HEALTHY; - return; - } - // if our map within recent history, try to add ourselves to the osdmap. if (osdmap->test_flag(CEPH_OSDMAP_NOUP)) { dout(5) << "osdmap NOUP flag is set, waiting for it to clear" << dendl; } else if (!g_ceph_context->get_heartbeat_map()->is_healthy()) { + // if we are not healthy, do not mark ourselves up (yet) dout(1) << "internal heartbeats indicate we are not healthy; waiting to boot" << dendl; + state = STATE_WAITING_FOR_HEALTHY; } else if (osdmap->get_epoch() >= oldest - 1 && osdmap->get_epoch() + g_conf->osd_map_message_max > newest) { _send_boot();