From 954ad98230085c9c2a174fe15af24df237498977 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 9 Nov 2010 13:17:25 -0800 Subject: [PATCH] osd: shut down if we do not exist Signed-off-by: Sage Weil --- src/osd/OSD.cc | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 5ce674d747294..797916d9cf17e 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2534,22 +2534,23 @@ void OSD::handle_osd_map(MOSDMap *m) pg->write_log(t); } + bool do_shutdown = false; if (osdmap->get_epoch() > 0 && - state == STATE_ACTIVE && - (!osdmap->exists(whoami) || - !osdmap->is_up(whoami) || - osdmap->get_addr(whoami) != client_messenger->get_myaddr())) { - dout(0) << "map says i am down or have a different address. state: active -> booting" << dendl; - //shutdown(); - - stringstream ss; - ss << "map e" << osdmap->get_epoch() << " wrongly marked me down"; - logclient.log(LOG_WARN, ss); - - state = STATE_BOOTING; - up_epoch = 0; + state == STATE_ACTIVE) { + if (!osdmap->exists(whoami)) { + dout(0) << "map says i do not exist. shutting down." << dendl; + do_shutdown = true; // don't call shutdown() while we have everything paused + } else if (!osdmap->is_up(whoami) || + osdmap->get_addr(whoami) != client_messenger->get_myaddr()) { + stringstream ss; + ss << "map e" << osdmap->get_epoch() << " wrongly marked me down"; + logclient.log(LOG_WARN, ss); + + state = STATE_BOOTING; + up_epoch = 0; - reset_heartbeat_peers(); + reset_heartbeat_peers(); + } } // note in the superblock that we were clean thru the prior epoch @@ -2588,6 +2589,8 @@ void OSD::handle_osd_map(MOSDMap *m) if (is_booting()) send_boot(); + if (do_shutdown) + shutdown(); if (map_in_progress_cond) { map_in_progress = false; -- 2.39.5