From a160dc416a7c19eccce66f36719468680cd151f4 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Mon, 10 Jun 2019 15:58:37 +0800 Subject: [PATCH] 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 --- src/mon/OSDMonitor.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index e5aa91a5a59..f8689998d15 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"; -- 2.39.5