From: Sage Weil Date: Fri, 6 Apr 2018 16:26:26 +0000 (-0500) Subject: mon/OSDMonitor: set last_force_resend_prenautilus for pg_num_pending changes X-Git-Tag: v14.0.1~371^2~39 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fffd50cee09b9ce7e70668ac099881c49b2129da;p=ceph.git mon/OSDMonitor: set last_force_resend_prenautilus for pg_num_pending changes This will force pre-nautilus clients to resend ops when we are adjusting pg_num_pending. This is a big hammer: for nautilus+ clients, we only have an interval change for the affected PGs (the two PGs that are about to merge), whereas this compat hack will do an op resend for the whole pool. However, it is better than requiring all clients be upgraded to nautilus in order to do PG merges. Note that we already do the same thing for pre-luminous clients both for splits, so we've already inflicted similar pain the past (and, to my knowledge, have not seen any negative feedback or fallout from that). Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 5e7a6003f2cb..0ba4dc8e42e2 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -3281,6 +3281,11 @@ bool OSDMonitor::prepare_pg_ready_to_merge(MonOpRequestRef op) p.dec_pg_num(); p.last_change = pending_inc.epoch; + + // force pre-nautilus clients to resend their ops, since they + // don't understand pg_num_pending changes form a new interval + p.last_force_op_resend_prenautilus = pending_inc.epoch; + pending_inc.new_pools[m->pgid.pool()] = p; wait_for_finished_proposal(op, new C_ReplyMap(this, op, m->version)); @@ -6872,14 +6877,6 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap, ss << "nautilus OSDs are required to adjust pg_num_pending"; return -EPERM; } - if (osdmap.require_min_compat_client > 0 && - osdmap.require_min_compat_client < CEPH_RELEASE_MIMIC) { - ss << "require_min_compat_client " - << ceph_release_name(osdmap.require_min_compat_client) - << " < mimic, which is required for pg merging. " - << "Try 'ceph osd set-require-min-compat-client mimic'."; - return -EPERM; - } if (n < (int)p.get_pgp_num()) { ss << "specified pg_num " << n << " < pgp_num " << p.get_pgp_num(); return -EINVAL; @@ -6890,6 +6887,9 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap, return -EINVAL; } p.set_pg_num_pending(n, pending_inc.epoch); + // force pre-nautilus clients to resend their ops, since they + // don't understand pg_num_pending 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. @@ -6938,14 +6938,6 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap, ss << "nautilus OSDs are required to adjust pg_num_pending"; return -EPERM; } - if (osdmap.require_min_compat_client > 0 && - osdmap.require_min_compat_client < CEPH_RELEASE_MIMIC) { - ss << "require_min_compat_client " - << ceph_release_name(osdmap.require_min_compat_client) - << " < mimic, which is required for pg merging. " - << "Try 'ceph osd set-require-min-compat-client mimic'."; - return -EPERM; - } if (n < (int)p.get_pgp_num_target()) { ss << "specified pg_num " << n << " < pgp_num " << p.get_pgp_num_target();