]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: change pg_stat plain to display CRUSH_ITEM_NONE in pgmap output section. 3549/head
authorVed-vampir <akiselyova@mirantis.com>
Fri, 30 Jan 2015 11:33:21 +0000 (13:33 +0200)
committerVed-vampir <akiselyova@mirantis.com>
Mon, 2 Feb 2015 10:29:42 +0000 (12:29 +0200)
Fixes: #10519
Signed-off-by: Kiseleva Alyona <akiselyova@mirantis.com>
src/mon/PGMap.cc
src/osd/osd_types.cc
src/osd/osd_types.h

index f540cb38aaf3ec1e7756a27ca83dc14c873d15ec..10d8ccb297dbd348c6733e745b3aa56178a983fa 100644 (file)
@@ -750,9 +750,9 @@ void PGMap::dump_pg_stats_plain(ostream& ss,
         << "\t" << st.last_change
         << "\t" << st.version
         << "\t" << st.reported_epoch << ":" << st.reported_seq
-        << "\t" << st.up
+        << "\t" << pg_vector_string(st.up)
         << "\t" << st.up_primary
-        << "\t" << st.acting
+        << "\t" << pg_vector_string(st.acting)
         << "\t" << st.acting_primary
         << "\t" << st.last_scrub << "\t" << st.last_scrub_stamp
         << "\t" << st.last_deep_scrub << "\t" << st.last_deep_scrub_stamp
index 7a2a35f62d61b7aeafb2feffd4b8f17215a710f0..58804725c2b9da5fd8dcbf242c762922e112aedc 100644 (file)
@@ -694,6 +694,22 @@ void coll_t::generate_test_instances(list<coll_t*>& o)
 
 // ---
 
+std::string pg_vector_string(const vector<int32_t> &a)
+{
+  ostringstream oss;
+  oss << "[";
+  for (vector<int32_t>::const_iterator i = a.begin(); i != a.end(); ++i) {
+    if (i != a.begin()) 
+      oss << ",";
+    if (*i != CRUSH_ITEM_NONE) 
+      oss << *i;
+    else 
+      oss << "NONE";
+  }
+  oss << "]";
+  return oss.str();
+}
+
 std::string pg_state_string(int state)
 {
   ostringstream oss;
index 14974b8d35f648a98e54bf213b1a5f40262f1752..28051547a9cc323367812cd4cfb61f547ab24cab 100644 (file)
@@ -770,7 +770,7 @@ inline ostream& operator<<(ostream& out, const osd_stat_t& s) {
 #define PG_STATE_ACTIVATING   (1<<24) // pg is peered but not yet active
 
 std::string pg_state_string(int state);
-
+std::string pg_vector_string(const vector<int32_t> &a);
 
 /*
  * pool_snap_info_t