]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: move old pool check to remove_down_temps
authorSage Weil <sage@redhat.com>
Tue, 10 May 2016 14:11:41 +0000 (10:11 -0400)
committerSage Weil <sage@redhat.com>
Thu, 12 May 2016 13:59:29 +0000 (09:59 -0400)
Better to do this on the projected map state.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSDMap.cc

index b64d4d79963cf5585eceef21f802650b2ec18268..5a481e20c57b103770a9a524873ae6847e694bd0 100644 (file)
@@ -1183,16 +1183,7 @@ void OSDMap::remove_redundant_temporaries(CephContext *cct, const OSDMap& osdmap
   for (map<pg_t,vector<int32_t> >::iterator p = osdmap.pg_temp->begin();
        p != osdmap.pg_temp->end();
        ++p) {
-
-    // if pool does not exist, remove any existing pg_temps associated with
-    // it.  we don't care about pg_temps on the pending_inc either; if there
-    // are new_pg_temp entries on the pending, clear them out just as well.
-    if (!osdmap.have_pg_pool(p->first.pool())) {
-      ldout(cct, 10) << " removing pg_temp " << p->first
-        << " for inexistent pool " << p->first.pool() << dendl;
-      pending_inc->new_pg_temp[p->first].clear();
-
-    } else if (pending_inc->new_pg_temp.count(p->first) == 0) {
+    if (pending_inc->new_pg_temp.count(p->first) == 0) {
       vector<int> raw_up;
       int primary;
       osdmap.pg_to_raw_up(p->first, &raw_up, &primary);
@@ -1227,7 +1218,7 @@ void OSDMap::remove_redundant_temporaries(CephContext *cct, const OSDMap& osdmap
 void OSDMap::remove_down_temps(CephContext *cct,
                                const OSDMap& osdmap, Incremental *pending_inc)
 {
-  ldout(cct, 10) << "remove_down_pg_temp" << dendl;
+  ldout(cct, 10) << __func__ << dendl;
   OSDMap tmpmap;
   tmpmap.deepish_copy_from(osdmap);
   tmpmap.apply_incremental(*pending_inc);
@@ -1235,6 +1226,15 @@ void OSDMap::remove_down_temps(CephContext *cct,
   for (map<pg_t,vector<int32_t> >::iterator p = tmpmap.pg_temp->begin();
        p != tmpmap.pg_temp->end();
        ++p) {
+    // if pool does not exist, remove any existing pg_temps associated with
+    // it.  we don't care about pg_temps on the pending_inc either; if there
+    // are new_pg_temp entries on the pending, clear them out just as well.
+    if (!osdmap.have_pg_pool(p->first.pool())) {
+      ldout(cct, 10) << __func__ << " removing pg_temp " << p->first
+                    << " for nonexistent pool " << p->first.pool() << dendl;
+      pending_inc->new_pg_temp[p->first].clear();
+      continue;
+    }
     // all osds down?
     unsigned num_up = 0;
     for (auto o : p->second) {