]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMap: move primary into UP and ACTING columns 20945/head
authorSage Weil <sage@redhat.com>
Mon, 19 Mar 2018 10:25:18 +0000 (05:25 -0500)
committerSage Weil <sage@redhat.com>
Mon, 19 Mar 2018 10:25:18 +0000 (05:25 -0500)
e.g., "[1,2,3]p1".  This matches what PG's operator<< does in the OSD
debug log, with the exception that the OSD leaves off the 'p123' bit on
replicated pools (which currently always make the first acting osd the
primary).  Leaving it on here to be explicit and a bit future-proof.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/PGMap.cc

index 4af015906280ec0b7068abd58432300c3f8d25b4..1c143c3746e15cb72ac0d3859182fb6bd6a7f006 100644 (file)
@@ -2079,9 +2079,7 @@ void PGMap::dump_filtered_pg_stats(ostream& ss, set<pg_t>& pgs) const
   tab.define_column("VERSION", TextTable::LEFT, TextTable::RIGHT);
   tab.define_column("REPORTED", TextTable::LEFT, TextTable::RIGHT);
   tab.define_column("UP", TextTable::LEFT, TextTable::RIGHT);
-  tab.define_column("UP_PRIMARY", TextTable::LEFT, TextTable::RIGHT);
   tab.define_column("ACTING", TextTable::LEFT, TextTable::RIGHT);
-  tab.define_column("ACTING_PRIMARY", TextTable::LEFT, TextTable::RIGHT);
   tab.define_column("SCRUB_STAMP", TextTable::LEFT, TextTable::RIGHT);
   tab.define_column("DEEP_SCRUB_STAMP", TextTable::LEFT, TextTable::RIGHT);
 
@@ -2091,6 +2089,9 @@ void PGMap::dump_filtered_pg_stats(ostream& ss, set<pg_t>& pgs) const
     ostringstream reported;
     reported << st.reported_epoch << ":" << st.reported_seq;
 
+    ostringstream upstr, actingstr;
+    upstr << st.up << 'p' << st.up_primary;
+    actingstr << st.acting << 'p' << st.acting_primary;
     tab << *i
         << st.stats.sum.num_objects
         << st.stats.sum.num_objects_degraded
@@ -2102,10 +2103,8 @@ void PGMap::dump_filtered_pg_stats(ostream& ss, set<pg_t>& pgs) const
         << st.last_change
         << st.version
         << reported.str()
-        << st.up
-        << st.up_primary
-        << st.acting
-        << st.acting_primary
+        << upstr.str()
+        << actingstr.str()
         << st.last_scrub_stamp
         << st.last_deep_scrub_stamp
         << TextTable::endrow;