From: xie xingguo Date: Mon, 10 Jun 2019 07:58:37 +0000 (+0800) Subject: mon/OSDMonitor: report pg[pgp]_num_target instead of pg[pgp]_num X-Git-Tag: v15.1.0~2461^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a160dc416a7c19eccce66f36719468680cd151f4;p=ceph.git mon/OSDMonitor: report pg[pgp]_num_target instead of pg[pgp]_num As by calling "ceph osd pool set 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 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 --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index e5aa91a5a59a..f8689998d150 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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";