From d778cab04323cef080c2f302be48bbb0eb07918e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 7 Feb 2012 09:04:37 -0800 Subject: [PATCH] mon: make [near]full_ratio config options floats ratio implies a real number, not a percentage. Correct, though, if it is > 1.0. Signed-off-by: Sage Weil --- src/common/config_opts.h | 4 ++-- src/mon/PGMonitor.cc | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index c988276c1b811..f088e45b7f2eb 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -98,8 +98,8 @@ OPTION(mon_clock_drift_allowed, OPT_FLOAT, .050) // allowed clock drift between OPTION(mon_clock_drift_warn_backoff, OPT_FLOAT, 5) // exponential backoff for clock drift warnings OPTION(mon_accept_timeout, OPT_FLOAT, 10.0) // on leader, if paxos update isn't accepted OPTION(mon_pg_create_interval, OPT_FLOAT, 30.0) // no more than every 30s -OPTION(mon_osd_full_ratio, OPT_INT, 95) // what % full makes an OSD "full" -OPTION(mon_osd_nearfull_ratio, OPT_INT, 85) // what % full makes an OSD near full +OPTION(mon_osd_full_ratio, OPT_FLOAT, .95) // what % full makes an OSD "full" +OPTION(mon_osd_nearfull_ratio, OPT_FLOAT, .85) // what % full makes an OSD near full OPTION(mon_globalid_prealloc, OPT_INT, 100) // how many globalids to prealloc OPTION(mon_osd_report_timeout, OPT_INT, 900) // grace period before declaring unresponsive OSDs dead OPTION(mon_force_standby_active, OPT_BOOL, true) // should mons force standby-replay mds to be active diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index f3be118c8ac31..a8205224f0991 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -195,8 +195,12 @@ void PGMonitor::tick() void PGMonitor::create_initial() { dout(10) << "create_initial -- creating initial map" << dendl; - pg_map.full_ratio = ((float)g_conf->mon_osd_full_ratio) / 100.0; - pg_map.nearfull_ratio = ((float)g_conf->mon_osd_nearfull_ratio) / 100.0; + pg_map.full_ratio = g_conf->mon_osd_full_ratio; + if (pg_map.full_ratio > 1.0) + pg_map.full_ratio /= 100.0; + pg_map.nearfull_ratio = g_conf->mon_osd_nearfull_ratio; + if (pg_map.nearfull_ratio > 1.0) + pg_map.nearfull_ratio /= 100.0; } bool PGMonitor::update_from_paxos() -- 2.39.5