]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: OSDMonitor: trigger an immediate propose if any newly down osd is detected durin... 7942/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 7 Apr 2016 08:43:17 +0000 (16:43 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 7 Apr 2016 09:31:59 +0000 (17:31 +0800)
    Currently we rely on OSDs to watch over each other and perform failure detection
    and report to OSDMonitor. Before we can safely and undoubtedly mark an OSD as down,
    enough reports from a certain number of different reporters must have been collected.
    Also, the victimed OSD has to be declared failed long enough before we make any final
    decision in order to avoid temperary problems such as network failure, network traffic jam etc.,
    which if handled carelessly, may cause even serious problem such as flapping.

    Form the above analysis, even if we have gathered enough witnesses, we have to wait long
    enough to sentence the guilty OSD to death. Therefore we rely on the tick() thread to
    do such an hourglass job. However, the problem here is currently the tick() thread is
    unable to trigger a propose even if it has witnessed such a memont, and this is our goal
    to solve such an embrassing situation.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h

index 2f3e02f077284a05089e82977c160a1689b9bbe4..eb077b0e4446ea35a818da2c25730e3e8b1e93ae 100644 (file)
@@ -1694,15 +1694,17 @@ bool OSDMonitor::can_mark_in(int i)
   return true;
 }
 
-void OSDMonitor::check_failures(utime_t now)
+bool OSDMonitor::check_failures(utime_t now)
 {
+  bool found_failure = false;
   for (map<int,failure_info_t>::iterator p = failure_info.begin();
        p != failure_info.end();
        ++p) {
     if (can_mark_down(p->first)) {
-      check_failure(now, p->first, p->second);
+      found_failure |= check_failure(now, p->first, p->second);
     }
   }
+  return found_failure;
 }
 
 bool OSDMonitor::check_failure(utime_t now, int target_osd, failure_info_t& fi)
@@ -2666,7 +2668,8 @@ void OSDMonitor::tick()
   utime_t now = ceph_clock_now(g_ceph_context);
 
   // mark osds down?
-  check_failures(now);
+  if (check_failures(now))
+    do_propose = true;
 
   // mark down osds out?
 
index 9d4d33d239bf8f5fcb2c39c37e8e2ccd6a57d910..3451b6a7e07146bdff6d7082dfb5d38edbbf5cb2 100644 (file)
@@ -134,7 +134,7 @@ private:
   SimpleLRU<version_t, bufferlist> inc_osd_cache;
   SimpleLRU<version_t, bufferlist> full_osd_cache;
 
-  void check_failures(utime_t now);
+  bool check_failures(utime_t now);
   bool check_failure(utime_t now, int target_osd, failure_info_t& fi);
 
   // map thrashing