summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-10-15 11:22:16 -0700
committerSage Weil <sage@inktank.com>2013-10-15 11:22:16 -0700
commit70cc6813262507405f3f726d21cede165fe87660 (patch)
tree09dece1fae3f55a07bcb44c7ea321147fee53b0d
parenta0ffba6de2e439300c7c181524694f9abf6b085d (diff)
downloadceph-70cc6813262507405f3f726d21cede165fe87660.tar.gz
mon/PGMonitor: set floor below which we do not warn about objects/pg
If a cluster has very few objects, do not generate warnings when the objects/pg for a pool diverges from the cluster average. This avoids spurious errors when you have a relatively empty cluster and a lone pool with a modest number of objects is too far off the (mostly meaningless) cluster-wide average. Also include a per-pool min so we ignore mostly-empty pools. Fixes: #6521 Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/common/config_opts.h2
-rw-r--r--src/mon/PGMonitor.cc4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/common/config_opts.h b/src/common/config_opts.h
index 2d3f981379b..08c2b0b4cae 100644
--- a/src/common/config_opts.h
+++ b/src/common/config_opts.h
@@ -160,6 +160,8 @@ OPTION(mon_pg_create_interval, OPT_FLOAT, 30.0) // no more than every 30s
OPTION(mon_pg_stuck_threshold, OPT_INT, 300) // number of seconds after which pgs can be considered inactive, unclean, or stale (see doc/control.rst under dump_stuck for more info)
OPTION(mon_pg_warn_min_per_osd, OPT_INT, 20) // min # pgs per (in) osd before we warn the admin
OPTION(mon_pg_warn_max_object_skew, OPT_FLOAT, 10.0) // max skew few average in objects per pg
+OPTION(mon_pg_warn_min_objects, OPT_INT, 10000) // do not warn below this object #
+OPTION(mon_pg_warn_min_pool_objects, OPT_INT, 1000) // do not warn on pools below this object #
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
diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc
index 2881e4985e3..c14872d87ef 100644
--- a/src/mon/PGMonitor.cc
+++ b/src/mon/PGMonitor.cc
@@ -1911,7 +1911,9 @@ void PGMonitor::get_health(list<pair<health_status_t,string> >& summary,
detail->push_back(make_pair(HEALTH_WARN, ss.str()));
}
int average_objects_per_pg = pg_map.pg_sum.stats.sum.num_objects / pg_map.pg_stat.size();
- if (average_objects_per_pg > 0) {
+ if (average_objects_per_pg > 0 &&
+ pg_map.pg_sum.stats.sum.num_objects >= g_conf->mon_pg_warn_min_objects &&
+ p->second.stats.sum.num_objects >= g_conf->mon_pg_warn_min_pool_objects) {
int objects_per_pg = p->second.stats.sum.num_objects / pi->get_pg_num();
float ratio = (float)objects_per_pg / (float)average_objects_per_pg;
if (g_conf->mon_pg_warn_max_object_skew > 0 &&