]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: rename mon_pg_warn_max_per_osd -> mon_max_pg_per_osd
authorSage Weil <sage@redhat.com>
Thu, 14 Sep 2017 20:00:31 +0000 (16:00 -0400)
committerSage Weil <sage@redhat.com>
Thu, 14 Sep 2017 20:00:31 +0000 (16:00 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
PendingReleaseNotes
qa/tasks/cephfs/test_volume_client.py
src/common/legacy_config_opts.h
src/common/options.cc
src/mon/OSDMonitor.cc
src/mon/PGMap.cc
src/pybind/ceph_volume_client.py

index 8de25f4c698a32988f4a1bf3c9096c4fcf67ecf3..6deb24feafe250aa30cceb27a6d2a52919fc7573 100644 (file)
 * The maximum number of PGs per OSD before the monitor issues a
   warning has been reduced from 300 to 200 PGs.  200 is still twice
   the generally recommended target of 100 PGs per OSD.  This limit can
-  be adjusted via the ``mon_pg_warn_max_per_osd`` option on the
-  monitors.
+  be adjusted via the ``mon_max_pg_per_osd`` option on the
+  monitors.  The older ``mon_pg_warn_max_per_osd`` option has been removed.
 
 * Creating pools or adjusting pg_num will now fail if the change would
   make the number of PGs per OSD exceed the configured
-  ``mon_pg_warn_max_per_osd`` limit.  The option can be adjusted if it
+  ``mon_max_pg_per_osd`` limit.  The option can be adjusted if it
   is really necessary to create a pool with more PGs.
index 65dc9a9eb856161e54a5e189aa1fc74e27f39061..43bd5c6a4cd16d169c60bdb14f5671ba142ee7da 100644 (file)
@@ -355,11 +355,11 @@ vc.disconnect()
         :return:
         """
 
-        # Because the teuthology config template sets mon_pg_warn_max_per_osd to
+        # Because the teuthology config template sets mon_max_pg_per_osd to
         # 10000 (i.e. it just tries to ignore health warnings), reset it to something
         # sane before using volume_client, to avoid creating pools with absurdly large
         # numbers of PGs.
-        self.set_conf("global", "mon pg warn max per osd", "300")
+        self.set_conf("global", "mon max pg per osd", "300")
         for mon_daemon_state in self.ctx.daemons.iter_daemons_of_role('mon'):
             mon_daemon_state.restart()
 
@@ -368,7 +368,7 @@ vc.disconnect()
 
         # Calculate how many PGs we'll expect the new volume pool to have
         osd_map = json.loads(self.fs.mon_manager.raw_cluster_cmd('osd', 'dump', '--format=json-pretty'))
-        max_per_osd = int(self.fs.get_config('mon_pg_warn_max_per_osd'))
+        max_per_osd = int(self.fs.get_config('mon_max_pg_per_osd'))
         osd_count = len(osd_map['osds'])
         max_overall = osd_count * max_per_osd
 
index 17e21773cbefab9d5a32c93c8884e57562f579fb..098a00c13633010f9e54effed67c008c2d9fd7a6 100644 (file)
@@ -237,7 +237,6 @@ OPTION(mon_timecheck_skew_interval, OPT_FLOAT) // on leader, timecheck (clock dr
 OPTION(mon_pg_stuck_threshold, OPT_INT) // number of seconds after which pgs can be considered stuck inactive, unclean, etc (see doc/control.rst under dump_stuck for more info)
 OPTION(mon_pg_min_inactive, OPT_U64) // the number of PGs which have to be inactive longer than 'mon_pg_stuck_threshold' before health goes into ERR. 0 means disabled, never go into ERR.
 OPTION(mon_pg_warn_min_per_osd, OPT_INT)  // min # pgs per (in) osd before we warn the admin
-OPTION(mon_pg_warn_max_per_osd, OPT_INT)  // max # pgs per (in) osd before we warn the admin
 OPTION(mon_pg_warn_max_object_skew, OPT_FLOAT) // max skew few average in objects per pg
 OPTION(mon_pg_warn_min_objects, OPT_INT)  // do not warn below this object #
 OPTION(mon_pg_warn_min_pool_objects, OPT_INT)  // do not warn on pools below this object #
index d81a98f5e6f86918beb0012521ef550df33b2539..a4bedd07644372dd32bdb95e2aa5afc76c73f943 100644 (file)
@@ -1030,9 +1030,9 @@ std::vector<Option> get_global_options() {
     .set_default(30)
     .set_description(""),
 
-    Option("mon_pg_warn_max_per_osd", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("mon_max_pg_per_osd", Option::TYPE_INT, Option::LEVEL_ADVANCED)
     .set_default(200)
-    .set_description(""),
+    .set_description("Max number of PGs per OSD the cluster will allow"),
 
     Option("mon_pg_warn_max_object_skew", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
     .set_default(10.0)
index 007e6f4fe3dae0edd7839b58d51e8d6e9f10b62c..58f139ebd53624b2bc0175fd05ab986c39f01b90 100644 (file)
@@ -5541,7 +5541,7 @@ int OSDMonitor::get_crush_rule(const string &rule_name,
 
 int OSDMonitor::check_pg_num(int64_t pool, int pg_num, int size, ostream *ss)
 {
-  int64_t max_pgs_per_osd = g_conf->mon_pg_warn_max_per_osd;
+  int64_t max_pgs_per_osd = g_conf->get_val<int64_t>("mon_max_pg_per_osd");
   int num_osds = MAX(osdmap.get_num_in_osds(), 3);   // assume min cluster size 3
   int64_t max_pgs = max_pgs_per_osd * num_osds;
   int64_t projected = 0;
@@ -5562,7 +5562,7 @@ int OSDMonitor::check_pg_num(int64_t pool, int pg_num, int size, ostream *ss)
     *ss << " pg_num " << pg_num << " size " << size
        << " would mean " << projected
        << " total pgs, which exceeds max " << max_pgs
-       << " (mon_pg_warn_max_per_osd " << max_pgs_per_osd
+       << " (mon_max_pg_per_osd " << max_pgs_per_osd
        << " * num_in_osds " << num_osds << ")";
     return -ERANGE;
   }
index b64d10c4f54179af33a7948fd5a339ea9a80ffbe..3cedc1b8741fcd47b7ab5f1fe4d7202dfaf2277c 100644 (file)
@@ -2387,12 +2387,13 @@ void PGMap::get_health_checks(
   }
 
   // TOO_MANY_PGS
-  if (num_in && cct->_conf->mon_pg_warn_max_per_osd > 0) {
+  int64_t max_pg_per_osd = cct->_conf->get_val<int64_t>("mon_max_pg_per_osd");
+  if (num_in && max_pg_per_osd > 0) {
     int per = sum_pg_up / num_in;
-    if (per > cct->_conf->mon_pg_warn_max_per_osd) {
+    if (per > max_pg_per_osd) {
       ostringstream ss;
       ss << "too many PGs per OSD (" << per
-        << " > max " << cct->_conf->mon_pg_warn_max_per_osd << ")";
+        << " > max " << max_pg_per_osd << ")";
       checks->add("TOO_MANY_PGS", HEALTH_WARN, ss.str());
     }
   }
index 89722ec95e737470427dedf1546fc58e0c65b832..5d03715e8fc9902d549ec5155273bc02a7d86d0d 100644 (file)
@@ -529,7 +529,7 @@ class CephFSVolumeClient(object):
         # We can't query the actual cluster config remotely, but since this is
         # just a heuristic we'll assume that the ceph.conf we have locally reflects
         # that in use in the rest of the cluster.
-        pg_warn_max_per_osd = int(self.rados.conf_get('mon_pg_warn_max_per_osd'))
+        pg_warn_max_per_osd = int(self.rados.conf_get('mon_max_pg_per_osd'))
 
         other_pgs = 0
         for pool in osd_map['pools']: