]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fall back to failsafe threshold if osdmap doesn't set [near]full 14004/head
authorSage Weil <sage@redhat.com>
Thu, 16 Mar 2017 21:24:52 +0000 (17:24 -0400)
committerSage Weil <sage@redhat.com>
Thu, 16 Mar 2017 21:24:52 +0000 (17:24 -0400)
This can happen during upgrade (it's normal) or it might happen if the user
did something very stupid (set full ratio to 0?).  Either way, degrade
gracefully by falling back to our locally configured failsafe threshold.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc

index 24b925b77f62e8ff7793edb6089990021381a5f0..2932e02ee1dda0ca15ae0367de0d2ce8f8e9d384 100644 (file)
@@ -732,11 +732,18 @@ void OSDService::check_full_status(const osd_stat_t &osd_stat)
   float full_ratio = std::max(osdmap->get_full_ratio(), nearfull_ratio);
   float failsafe_ratio = std::max(get_failsafe_full_ratio(), full_ratio);
 
-  if (full_ratio <= 0 ||
-      nearfull_ratio <= 0) {
+  if (!osdmap->test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) {
+    // use the failsafe for nearfull and full; the mon isn't using the
+    // flags anyway because we're mid-upgrade.
+    full_ratio = failsafe_ratio;
+    nearfull_ratio = failsafe_ratio;
+  } else if (full_ratio <= 0 ||
+            nearfull_ratio <= 0) {
     derr << __func__ << " full_ratio or nearfull_ratio is <= 0" << dendl;
-    cur_state = NONE;
-    return;
+    // use failsafe flag.  ick.  the monitor did something wrong or the user
+    // did something stupid.
+    full_ratio = failsafe_ratio;
+    nearfull_ratio = failsafe_ratio;
   }
 
   enum s_names new_state;