]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDmap: fix OSDMap::Incremental::dump() for new pool names
authorSage Weil <sage@inktank.com>
Fri, 12 Jul 2013 01:43:24 +0000 (18:43 -0700)
committerSage Weil <sage@inktank.com>
Fri, 12 Jul 2013 16:48:38 +0000 (09:48 -0700)
The name is always present when pools are created, but not when they are
modified.  Also, a name may be present with a new_pools entry if the pool
is just renamed.  Separate it out completely in the dump.

Backport: cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/OSDMap.cc

index 9eecf173e5baf0eed12b8f858a12ecd18342234a..0d0afe2104150258e948a6931e244058aea10eef 100644 (file)
@@ -456,11 +456,18 @@ void OSDMap::Incremental::dump(Formatter *f) const
   for (map<int64_t,pg_pool_t>::const_iterator p = new_pools.begin(); p != new_pools.end(); ++p) {
     f->open_object_section("pool");
     f->dump_int("pool", p->first);
-    f->dump_string("name", new_pool_names.find(p->first)->second);
     p->second.dump(f);
     f->close_section();
   }
   f->close_section();
+  f->open_array_section("new_pool_names");
+  for (map<int64_t,string>::const_iterator p = new_pool_names.begin(); p != new_pool_names.end(); ++p) {
+    f->open_object_section("pool_name");
+    f->dump_int("pool", p->first);
+    f->dump_string("name", p->second);
+    f->close_section();
+  }
+  f->close_section();
   f->open_array_section("old_pools");
   for (set<int64_t>::const_iterator p = old_pools.begin(); p != old_pools.end(); ++p)
     f->dump_int("pool", *p);