]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSD: keep synchronizing with mon if stuck at booting 28404/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 31 May 2019 06:18:40 +0000 (14:18 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 5 Jun 2019 08:45:46 +0000 (16:45 +0800)
During the flapping no{up,down,in,out} flags test I've noticed
that some osds might be stuck at down&booting state due to the
unawareness of noup flag changing.
Fix by subscribing (continuous) to next osd map, just as we do
if we are stuck at unhealthy.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/OSD.cc

index 744dda22caa23cdcac2ef8b3476e9e7f79ce985c..2257c2061ac4e36337755dfe843bde028a058f84 100644 (file)
@@ -4886,15 +4886,15 @@ void OSD::tick()
 
   if (is_waiting_for_healthy()) {
     start_boot();
-    if (is_waiting_for_healthy()) {
-      // failed to boot
-      std::lock_guard l(heartbeat_lock);
-      utime_t now = ceph_clock_now();
-      if (now - last_mon_heartbeat > cct->_conf->osd_mon_heartbeat_interval) {
-        last_mon_heartbeat = now;
-        dout(1) << __func__ << " checking mon for new map" << dendl;
-        osdmap_subscribe(osdmap->get_epoch() + 1, false);
-      }
+  }
+
+  if (is_waiting_for_healthy() || is_booting()) {
+    std::lock_guard l(heartbeat_lock);
+    utime_t now = ceph_clock_now();
+    if (now - last_mon_heartbeat > cct->_conf->osd_mon_heartbeat_interval) {
+      last_mon_heartbeat = now;
+      dout(1) << __func__ << " checking mon for new map" << dendl;
+      osdmap_subscribe(osdmap->get_epoch() + 1, false);
     }
   }