From: Sage Weil Date: Fri, 12 Jul 2013 01:43:24 +0000 (-0700) Subject: osd/OSDmap: fix OSDMap::Incremental::dump() for new pool names X-Git-Tag: v0.67-rc1~59^2~15^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e4a29111e89588385e63f8d92ce3d67739dd679;p=ceph.git osd/OSDmap: fix OSDMap::Incremental::dump() for new pool names 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 --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 9eecf173e5ba..0d0afe210415 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -456,11 +456,18 @@ void OSDMap::Incremental::dump(Formatter *f) const for (map::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::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::const_iterator p = old_pools.begin(); p != old_pools.end(); ++p) f->dump_int("pool", *p);