From: Vikhyat Umrao Date: Wed, 26 Aug 2020 10:17:05 +0000 (-0700) Subject: mon/PGMap: add pg count for pools in the ceph df command X-Git-Tag: v16.1.0~1277^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F36819%2Fhead;p=ceph.git mon/PGMap: add pg count for pools in the ceph df command Fixes: https://tracker.ceph.com/issues/46663 Signed-off-by: Vikhyat Umrao --- diff --git a/PendingReleaseNotes b/PendingReleaseNotes index c0189f712cf6..b8b946d63095 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -1,6 +1,8 @@ >=16.0.0 -------- +* The ``ceph df`` command now lists the number of pgs in each pool. + * Monitors now have config option ``mon_allow_pool_size_one``, which is disabled by default. However, if enabled, user now have to pass the ``--yes-i-really-mean-it`` flag to ``osd pool set size 1``, if they are really diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 2cf3fad53fcc..176b64e15717 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -762,6 +762,7 @@ void PGMapDigest::dump_pool_stats_full( } else { tbl.define_column("POOL", TextTable::LEFT, TextTable::LEFT); tbl.define_column("ID", TextTable::LEFT, TextTable::RIGHT); + tbl.define_column("PGS", TextTable::LEFT, TextTable::RIGHT); tbl.define_column("STORED", TextTable::LEFT, TextTable::RIGHT); if (verbose) { tbl.define_column("(DATA)", TextTable::LEFT, TextTable::RIGHT); @@ -793,6 +794,7 @@ void PGMapDigest::dump_pool_stats_full( continue; const string& pool_name = osd_map.get_pool_name(pool_id); + auto pool_pg_num = osd_map.get_pg_num(pool_id); const pool_stat_t &stat = pg_pool_sum.at(pool_id); const pg_pool_t *pool = osd_map.get_pg_pool(pool_id); @@ -816,7 +818,8 @@ void PGMapDigest::dump_pool_stats_full( f->open_object_section("stats"); } else { tbl << pool_name - << pool_id; + << pool_id + << pool_pg_num; } float raw_used_rate = osd_map.pool_raw_used_rate(pool_id); bool per_pool = use_per_pool_stats();