]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: handle incrementals that modify+del pool 5420/head
authorJohn Spray <john.spray@redhat.com>
Thu, 30 Jul 2015 13:20:56 +0000 (14:20 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 30 Jul 2015 13:23:42 +0000 (14:23 +0100)
Because new_pools was processed after old_pools, if something
was modified and then deleted in the same incremental
map, then the resulting state would be a pool in the map
that had no entry in pool_name.

Fixes: #12429
Signed-off-by: John Spray <john.spray@redhat.com>
src/osd/OSDMap.cc

index c13f64a4a6978a6f31d6fe4ff81ae0942ab763f9..ddad99fb38a9bc40f9fe81c3aaf83e12b1c311ff 100644 (file)
@@ -1283,13 +1283,6 @@ int OSDMap::apply_incremental(const Incremental &inc)
   if (inc.new_pool_max != -1)
     pool_max = inc.new_pool_max;
 
-  for (set<int64_t>::const_iterator p = inc.old_pools.begin();
-       p != inc.old_pools.end();
-       ++p) {
-    pools.erase(*p);
-    name_pool.erase(pool_name[*p]);
-    pool_name.erase(*p);
-  }
   for (map<int64_t,pg_pool_t>::const_iterator p = inc.new_pools.begin();
        p != inc.new_pools.end();
        ++p) {
@@ -1304,6 +1297,13 @@ int OSDMap::apply_incremental(const Incremental &inc)
     pool_name[p->first] = p->second;
     name_pool[p->second] = p->first;
   }
+  for (set<int64_t>::const_iterator p = inc.old_pools.begin();
+       p != inc.old_pools.end();
+       ++p) {
+    pools.erase(*p);
+    name_pool.erase(pool_name[*p]);
+    pool_name.erase(*p);
+  }
 
   for (map<int32_t,uint32_t>::const_iterator i = inc.new_weight.begin();
        i != inc.new_weight.end();