* 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.
: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()
# 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
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 #
.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)
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;
*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;
}
}
// 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());
}
}
# 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']: