From: Sage Weil Date: Thu, 16 Mar 2017 21:24:52 +0000 (-0400) Subject: osd: fall back to failsafe threshold if osdmap doesn't set [near]full X-Git-Tag: v12.0.1~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f088054f626ed57068e1ef94328b916669bb4377;p=ceph.git osd: fall back to failsafe threshold if osdmap doesn't set [near]full 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 --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 24b925b77f62..2932e02ee1dd 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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;