]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: simplify is_healthy() check during boot
authorSage Weil <sage@inktank.com>
Mon, 27 May 2013 22:24:56 +0000 (15:24 -0700)
committerSage Weil <sage@inktank.com>
Wed, 29 May 2013 20:41:43 +0000 (13:41 -0700)
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 <sage@inktank.com>
src/osd/OSD.cc

index 8993a1100f5f3a9fa96259944695d308b93a4ece..26a601ed91a4a5eb76b99731854f29e74667e1ae 100644 (file)
@@ -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();