]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: report pg[pgp]_num_target instead of pg[pgp]_num 28490/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 10 Jun 2019 07:58:37 +0000 (15:58 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 11 Jun 2019 12:39:05 +0000 (20:39 +0800)
As by calling "ceph osd pool set <pool-name> pg_num", we set the
pg_num_target instead. Hence we should report pg_num_target as well
when invoked by the "ceph osd pool get <pool-name> pg_num" call.

I doubt an ideal fix would be exposing both the pg_num(*actual*) and
pg_num_target concepts to user, but for now I think we can stop here
and get some more feedback first.

Fixes: http://tracker.ceph.com/issues/40193
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/mon/OSDMonitor.cc

index e5aa91a5a59a20571826780010f71f8da22ef238..f8689998d150df2f39d6dcd7e2bcced981452d74 100644 (file)
@@ -5520,10 +5520,10 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
         ceph_assert(i != ALL_CHOICES.end());
        switch(*it) {
          case PG_NUM:
-           f->dump_int("pg_num", p->get_pg_num());
+           f->dump_int("pg_num", p->get_pg_num_target());
            break;
          case PGP_NUM:
-           f->dump_int("pgp_num", p->get_pgp_num());
+           f->dump_int("pgp_num", p->get_pgp_num_target());
            break;
          case SIZE:
            f->dump_int("size", p->get_size());
@@ -5678,10 +5678,10 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
        choices_map_t::const_iterator i;
        switch(*it) {
          case PG_NUM:
-           ss << "pg_num: " << p->get_pg_num() << "\n";
+           ss << "pg_num: " << p->get_pg_num_target() << "\n";
            break;
          case PGP_NUM:
-           ss << "pgp_num: " << p->get_pgp_num() << "\n";
+           ss << "pgp_num: " << p->get_pgp_num_target() << "\n";
            break;
          case SIZE:
            ss << "size: " << p->get_size() << "\n";