logger->set(l_osd_buf, buffer::get_total_alloc());
+ if (is_waiting_for_healthy()) {
+ if (g_ceph_context->get_heartbeat_map()->is_healthy()) {
+ dout(1) << "healthy again, booting" << dendl;
+ state = STATE_BOOTING;
+ start_boot();
+ }
+ }
+
if (is_active()) {
// periodically kick recovery work queue
recovery_tp.wake();
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;
static const int STATE_BOOTING = 2;
static const int STATE_ACTIVE = 3;
static const int STATE_STOPPING = 4;
+ static const int STATE_WAITING_FOR_HEALTHY = 5;
private:
int state;
bool is_booting() { return state == STATE_BOOTING; }
bool is_active() { return state == STATE_ACTIVE; }
bool is_stopping() { return state == STATE_STOPPING; }
+ bool is_waiting_for_healthy() { return state == STATE_WAITING_FOR_HEALTHY; }
private: