]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMonitor: health warn if pg_num != pgp_num
authorSage Weil <sage@inktank.com>
Sat, 21 Sep 2013 06:07:54 +0000 (23:07 -0700)
committerSage Weil <sage@inktank.com>
Mon, 23 Sep 2013 21:56:48 +0000 (14:56 -0700)
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>
src/mon/PGMonitor.cc

index b27ba7749f467e2d7c5fd7458f8cf029a4bd61d2..d1676b26b694374839e69d73d61a0fe4576d6c40 100644 (file)
@@ -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,