From: Sage Weil Date: Sat, 21 Sep 2013 06:07:54 +0000 (-0700) Subject: mon/PGMonitor: health warn if pg_num != pgp_num X-Git-Tag: v0.71~92^2^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a684ac822077fb3f84ebc996dee3feb2a756f74e;p=ceph.git mon/PGMonitor: health warn if pg_num != pgp_num Users need to adjust pg_num *and* pgp_num for split but may forget to do both. Signed-off-by: Sage Weil --- diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index b27ba7749f46..d1676b26b694 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -1860,6 +1860,21 @@ void PGMonitor::get_health(list >& summary, detail->push_back(make_pair(HEALTH_WARN, ss.str())); } } + if (!pg_map.pg_stat.empty()) { + for (hash_map::const_iterator p = pg_map.pg_pool_sum.begin(); + p != pg_map.pg_pool_sum.end(); + ++p) { + const pg_pool_t *pi = mon->osdmon()->osdmap.get_pg_pool(p->first); + if (pi->get_pg_num() > pi->get_pgp_num()) { + ostringstream ss; + ss << "pool " << mon->osdmon()->osdmap.get_pool_name(p->first) << " pg_num " + << pi->get_pg_num() << " > pgp_num " << pi->get_pgp_num(); + summary.push_back(make_pair(HEALTH_WARN, ss.str())); + if (detail) + detail->push_back(make_pair(HEALTH_WARN, ss.str())); + } + } + } } void PGMonitor::check_full_osd_health(list >& summary,