]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: make [near]full_ratio config options floats
authorSage Weil <sage@newdream.net>
Tue, 7 Feb 2012 17:04:37 +0000 (09:04 -0800)
committerSage Weil <sage@newdream.net>
Wed, 8 Feb 2012 21:12:18 +0000 (13:12 -0800)
ratio implies a real number, not a percentage.  Correct, though, if it is
> 1.0.

Signed-off-by: Sage Weil <sage@newdream.net>
src/common/config_opts.h
src/mon/PGMonitor.cc

index c988276c1b8113b28f22441e9677ef1eabf05926..f088e45b7f2ebc05131bf7fd71245211e9df816d 100644 (file)
@@ -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
index f3be118c8ac31c5f31b5b7e830344c32e1142ecb..a8205224f09918619f4980f5b08a857f569aacb5 100644 (file)
@@ -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()