]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG::actingset should be used when checking the number of acting OSDs for a given PG. 4453/head
authorGuang Yang <yguang@yahoo-inc.com>
Mon, 29 Sep 2014 08:21:10 +0000 (08:21 +0000)
committerDavid Zafman <dzafman@redhat.com>
Thu, 23 Apr 2015 16:51:18 +0000 (09:51 -0700)
Signed-off-by: Guang Yang <yguang@yahoo-inc.com>
(cherry picked from commit 19be358322be48fafa17b28054619a8b5e7d403b)

Conflicts:
src/osd/PG.cc PG::get_backfill_priority() doesn't exist in firefly
Variation in code related to no "undersized" state in firefly

Fixes: #11454
src/osd/PG.cc

index ad5cd89fcee322f6d576dc7062ce51479703e078..60567d4a803ca6e93f3951d22bee78bbeb86ea92 100644 (file)
@@ -1659,7 +1659,7 @@ void PG::activate(ObjectStore::Transaction& t,
     }
 
     // degraded?
-    if (get_osdmap()->get_pg_size(info.pgid.pgid) > acting.size())
+    if (get_osdmap()->get_pg_size(info.pgid.pgid) > actingset.size())
       state_set(PG_STATE_DEGRADED);
 
   }
@@ -6404,13 +6404,11 @@ boost::statechart::result PG::RecoveryState::Active::react(const AdvMap& advmap)
     pg->dirty_big_info = true;
   }
 
-  for (vector<int>::iterator p = pg->want_acting.begin();
-       p != pg->want_acting.end(); ++p) {
-    if (!advmap.osdmap->is_up(*p)) {
-      assert((std::find(pg->acting.begin(), pg->acting.end(), *p) !=
-             pg->acting.end()) ||
-            (std::find(pg->up.begin(), pg->up.end(), *p) !=
-             pg->up.end()));
+  for (size_t i = 0; i < pg->want_acting.size(); i++) {
+    int osd = pg->want_acting[i];
+    if (!advmap.osdmap->is_up(osd)) {
+      pg_shard_t osd_with_shard(osd, shard_id_t(i));
+      assert(pg->is_acting(osd_with_shard) || pg->is_up(osd_with_shard));
     }
   }
 
@@ -6418,7 +6416,7 @@ boost::statechart::result PG::RecoveryState::Active::react(const AdvMap& advmap)
    * this does not matter) */
   if (advmap.lastmap->get_pg_size(pg->info.pgid.pgid) !=
       pg->get_osdmap()->get_pg_size(pg->info.pgid.pgid)) {
-    if (pg->get_osdmap()->get_pg_size(pg->info.pgid.pgid) <= pg->acting.size())
+    if (pg->get_osdmap()->get_pg_size(pg->info.pgid.pgid) <= pg->actingset.size())
       pg->state_clear(PG_STATE_DEGRADED);
     else
       pg->state_set(PG_STATE_DEGRADED);