]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: skip new pools in update_pools_status() and get_pools_health()
authorSamuel Just <sam.just@inktank.com>
Tue, 21 May 2013 22:22:56 +0000 (15:22 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 31 May 2013 17:59:58 +0000 (10:59 -0700)
New pools won't be full.  mon->pgmon()->pg_map.pg_pool_sum[poolid] will
implicitly create an entry for poolid causing register_new_pgs() to assume that
the newly created pgs in the new pool are in fact a result of a split
preventing MOSDPGCreate messages from being sent out.

Fixes: #4813
Backport: cuttlefish
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 0289c445be0269157fa46bbf187c92639a13db46)

src/mon/OSDMonitor.cc

index 9582609fdec2192ce1bdc814232a8d7c49802519..2370ba3c8d4c8efc139b404c91598a8ea0faaef6 100644 (file)
@@ -2263,6 +2263,8 @@ bool OSDMonitor::update_pools_status()
   for (map<int64_t,pg_pool_t>::const_iterator it = pools.begin();
        it != pools.end();
        ++it) {
+    if (!mon->pgmon()->pg_map.pg_pool_sum.count(it->first))
+      continue;
     pool_stat_t& stats = mon->pgmon()->pg_map.pg_pool_sum[it->first];
     object_stat_sum_t& sum = stats.stats.sum;
     const pg_pool_t &pool = it->second;
@@ -2312,6 +2314,8 @@ void OSDMonitor::get_pools_health(
   const map<int64_t,pg_pool_t>& pools = osdmap.get_pools();
   for (map<int64_t,pg_pool_t>::const_iterator it = pools.begin();
        it != pools.end(); ++it) {
+    if (!mon->pgmon()->pg_map.pg_pool_sum.count(it->first))
+      continue;
     pool_stat_t& stats = mon->pgmon()->pg_map.pg_pool_sum[it->first];
     object_stat_sum_t& sum = stats.stats.sum;
     const pg_pool_t &pool = it->second;