From: Sage Weil Date: Fri, 14 Jul 2017 14:53:14 +0000 (-0400) Subject: osd: restart boot process if waiting for luminous mons X-Git-Tag: v12.1.1~3^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16341%2Fhead;p=ceph.git osd: restart boot process if waiting for luminous mons If we start_boot and see that we don't have luminous mons, we will stop. But we don't currently reliably notice when the luminous upgrade completes. If we happen to be connected to the last mon we will start_boot() because of the trigger in ms_handle_connect(), but if we are not connected to the last mon we'll eventually get a monmap update but not restart booting. Fix by setting a flag if we are waiting, and restart boot if the flag is set, we are in preboot, and we see we now have luminous mons. Fixes: http://tracker.ceph.com/issues/20631 Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 0e0b6ba25ec6..2600f52dfeac 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4987,6 +4987,12 @@ void OSD::tick() if (is_waiting_for_healthy()) { start_boot(); + } else if (is_preboot() && + waiting_for_luminous_mons && + monc->monmap.get_required_features().contains_all( + ceph::features::mon::FEATURE_LUMINOUS)) { + // mon upgrade finished! + start_boot(); } do_waiters(); @@ -5599,6 +5605,7 @@ void OSD::start_boot() } dout(1) << __func__ << dendl; set_state(STATE_PREBOOT); + waiting_for_luminous_mons = false; dout(10) << "start_boot - have maps " << superblock.oldest_map << ".." << superblock.newest_map << dendl; C_OSD_GetVersion *c = new C_OSD_GetVersion(this); @@ -5637,6 +5644,7 @@ void OSD::_preboot(epoch_t oldest, epoch_t newest) ceph::features::mon::FEATURE_LUMINOUS)) { derr << "monmap REQUIRE_LUMINOUS is NOT set; must upgrade all monitors to " << "Luminous or later before Luminous OSDs will boot" << dendl; + waiting_for_luminous_mons = true; } else if (service.need_fullness_update()) { derr << "osdmap fullness state needs update" << dendl; send_full_update(); diff --git a/src/osd/OSD.h b/src/osd/OSD.h index c34e247e4440..bfa511e8b077 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1342,6 +1342,7 @@ public: private: std::atomic_int state{STATE_INITIALIZING}; + bool waiting_for_luminous_mons = false; public: int get_state() const {