Skip to content

Commit

Permalink
osd/OSDMap: include pg_temp count in summary
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit db06582)
  • Loading branch information
liewegas committed Feb 19, 2015
1 parent d999ccb commit c463242
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/osd/OSDMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
3 changes: 3 additions & 0 deletions src/osd/OSDMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ class OSDMap {
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; }
Expand Down

0 comments on commit c463242

Please sign in to comment.