From: Sage Weil Date: Thu, 12 Feb 2015 22:16:53 +0000 (-0800) Subject: osd/OSDMap: include pg_temp count in summary X-Git-Tag: v0.93~30 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c4632427e26d63ba78e1c3653c781ad97e613b8a;p=ceph.git osd/OSDMap: include pg_temp count in summary It is useful to know how big the pg_temp map is. Strictly speaking this is part of the OSDMap so I'm including it here. It looks like this: osdmap e25: 3 osds: 3 up, 3 in; 1 remapped pgs It might be more user-friendly to put it in a line with the pgmap somewhere (where other pg counts are included), but it doesn't quite fit there either. So sticking with where it lives in the data structure! Signed-off-by: Sage Weil (cherry picked from commit db06582a067439a57e0d7f0da2193fc479736200) --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index e93040c33c0b..174c81dca081 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -2575,12 +2575,16 @@ void OSDMap::print_summary(Formatter *f, ostream& out) const f->dump_int("num_in_osds", get_num_in_osds()); f->dump_bool("full", test_flag(CEPH_OSDMAP_FULL) ? true : false); f->dump_bool("nearfull", test_flag(CEPH_OSDMAP_NEARFULL) ? true : false); + f->dump_unsigned("num_remapped_pgs", get_num_pg_temp()); f->close_section(); } else { out << " osdmap e" << get_epoch() << ": " << get_num_osds() << " osds: " << get_num_up_osds() << " up, " - << get_num_in_osds() << " in\n"; + << get_num_in_osds() << " in"; + if (get_num_pg_temp()) + out << "; " << get_num_pg_temp() << " remapped pgs"; + out << "\n"; if (flags) out << " flags " << get_flag_string() << "\n"; } diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index a38533db8b0e..60e26102f48a 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -331,6 +331,9 @@ public: void get_up_osds(set& ls) const; unsigned get_num_up_osds() const; unsigned get_num_in_osds() const; + unsigned get_num_pg_temp() const { + return pg_temp->size(); + } int get_flags() const { return flags; } int test_flag(int f) const { return flags & f; }