From: Sage Weil Date: Thu, 2 May 2019 16:18:17 +0000 (-0500) Subject: mon/OSDMonitor: allow pg_num to increase when require_osd_release < N X-Git-Tag: v15.1.0~2695^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7e7134aa9317a0d64503edb20b9ea1f4035c7e9e;p=ceph.git mon/OSDMonitor: allow pg_num to increase when require_osd_release < N Setting pg_num_target has no effect when we encode our OSDMap with mimic or luminous features. Fall back to the pre-nautilus behavior of directly setting pg_num. Fixes: http://tracker.ceph.com/issues/39570 Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index ba6a888d9190..232a75aecd47 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -7413,14 +7413,26 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap, return -EPERM; } } - // 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); + if (osdmap.require_osd_release < ceph_release_t::nautilus) { + // pre-nautilus osdmap format; increase pg_num directly + assert(n > (int)p.get_pg_num()); + // force pre-nautilus clients to resend their ops, since they + // don't understand pg_num_target changes form a new interval + p.last_force_op_resend_prenautilus = pending_inc.epoch; + // force pre-luminous clients to resend their ops, since they + // don't understand that split PGs now form a new interval. + p.last_force_op_resend_preluminous = pending_inc.epoch; + p.set_pg_num(n); + } else { + // 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); } - 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"; @@ -7461,7 +7473,12 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap, ss << "specified pgp_num " << n << " > pg_num " << p.get_pg_num_target(); return -EINVAL; } - p.set_pgp_num_target(n); + if (osdmap.require_osd_release < ceph_release_t::nautilus) { + // pre-nautilus osdmap format; increase pgp_num directly + p.set_pgp_num(n); + } else { + p.set_pgp_num_target(n); + } } else if (var == "pg_autoscale_mode") { n = pg_pool_t::get_pg_autoscale_mode_by_name(val); if (n < 0) {