]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: include pg_temp count in summary
authorSage Weil <sage@redhat.com>
Thu, 12 Feb 2015 22:16:53 +0000 (14:16 -0800)
committerSage Weil <sage@redhat.com>
Thu, 19 Feb 2015 19:10:12 +0000 (11:10 -0800)
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 <sage@redhat.com>
(cherry picked from commit db06582a067439a57e0d7f0da2193fc479736200)

src/osd/OSDMap.cc
src/osd/OSDMap.h

index e93040c33c0b253aab1549ea620ed9b240ddcabd..174c81dca0810ece6efa7dda6c273849cf7afc6c 100644 (file)
@@ -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";
   }
index a38533db8b0ec6e9df200704fcac591d8f706f0f..60e26102f48aa6d66ff930155ddd6f2c51bf65ad 100644 (file)
@@ -331,6 +331,9 @@ public:
   void get_up_osds(set<int32_t>& 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; }