]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: handle pool name changes properly
authorSage Weil <sage@inktank.com>
Sat, 30 Jun 2012 02:54:35 +0000 (19:54 -0700)
committerSage Weil <sage@inktank.com>
Sat, 30 Jun 2012 02:54:35 +0000 (19:54 -0700)
 * Remove the old name from the name->id map.

Fixes: #2676
Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/OSDMap.cc

index 297bb7fc2e1eddbd34696f74aee36e4a57a90499..a6bca13b1b0c7305f95fc04a8cc30ed39bbfaa2d 100644 (file)
@@ -688,6 +688,8 @@ int OSDMap::apply_incremental(Incremental &inc)
   for (map<int64_t,string>::iterator p = inc.new_pool_names.begin();
        p != inc.new_pool_names.end();
        p++) {
+    if (pool_name.count(p->first))
+      name_pool.erase(pool_name[p->first]);
     pool_name[p->first] = p->second;
     name_pool[p->second] = p->first;
   }