]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: restart boot process if waiting for luminous mons 16341/head
authorSage Weil <sage@redhat.com>
Fri, 14 Jul 2017 14:53:14 +0000 (10:53 -0400)
committerSage Weil <sage@redhat.com>
Fri, 14 Jul 2017 14:53:14 +0000 (10:53 -0400)
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 <sage@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h

index 0e0b6ba25ec6fa34f49e42ce4ec1f79e3d7b0fea..2600f52dfeac292f4af1f5bc093a4f55086177ac 100644 (file)
@@ -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();
index c34e247e44402822a9f523386acda84fc9014cd4..bfa511e8b077df2d9864dae429eba84946a5b954 100644 (file)
@@ -1342,6 +1342,7 @@ public:
 
 private:
   std::atomic_int state{STATE_INITIALIZING};
+  bool waiting_for_luminous_mons = false;
 
 public:
   int get_state() const {