From: Sage Weil Date: Wed, 19 Sep 2018 18:56:10 +0000 (-0500) Subject: mon/OSDMonitor: make pgp_num track pg_num more consistently X-Git-Tag: 3.2-0~147^2~15 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=48412ce4e4e21ed271682614341b6f570a9f8999;p=ceph-ci.git mon/OSDMonitor: make pgp_num track pg_num more consistently Previously we were automatically adjusting pgp_num_target on a pg_num_target change *only* when decreasing pg_num. Instead, make pgp_num (continue to) track pg_num if it currently matches. If it ever is set differently than pg_num, leave it different (unless/until it matches again). This is still slightly weird, but I think in practice it is good enough. In the rare case that the admin manually sets pgp_num to something different than pg_num, they probably won't also be using automagic pg_num adjustment that might make them match and start tracking again. Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 471855cf68e..9bb6f7e2bf4 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -6987,12 +6987,14 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap, return -EPERM; } } - // set target; mgr will adjust pg_num_actual later - p.set_pg_num_target(n); - // adjust pgp_num_target down too (as needed) - if (p.get_pgp_num_target() > n) { + // set targets; mgr will adjust pg_num_actual and pgp_num later. + // make pgp_num track pg_num if it already matches. if it is set + // differently, leave it different and let the user control it + // manually. + if (p.get_pg_num_target() == p.get_pgp_num_target()) { p.set_pgp_num_target(n); } + p.set_pg_num_target(n); } else if (var == "pgp_num_actual") { if (p.has_flag(pg_pool_t::FLAG_NOPGCHANGE)) { ss << "pool pgp_num change is disabled; you must unset nopgchange flag for the pool first";