summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-09-20 23:07:54 -0700
committerSage Weil <sage@inktank.com>2013-09-23 14:56:48 -0700
commita684ac822077fb3f84ebc996dee3feb2a756f74e (patch)
tree70e191bb2e1d0976b76f6571b2d34564cbe8ec24
parentdc7114e060a84fea603025a50998b5ea0bf6c682 (diff)
downloadceph-a684ac822077fb3f84ebc996dee3feb2a756f74e.tar.gz
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 <sage@inktank.com>
-rw-r--r--src/mon/PGMonitor.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc
index b27ba7749f4..d1676b26b69 100644
--- a/src/mon/PGMonitor.cc
+++ b/src/mon/PGMonitor.cc
@@ -1860,6 +1860,21 @@ void PGMonitor::get_health(list<pair<health_status_t,string> >& summary,
detail->push_back(make_pair(HEALTH_WARN, ss.str()));
}
}
+ if (!pg_map.pg_stat.empty()) {
+ for (hash_map<int,pool_stat_t>::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<pair<health_status_t,string> >& summary,