]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: set last_force_resend_prenautilus for pg_num_pending changes
authorSage Weil <sage@redhat.com>
Fri, 6 Apr 2018 16:26:26 +0000 (11:26 -0500)
committerSage Weil <sage@redhat.com>
Fri, 7 Sep 2018 17:08:40 +0000 (12:08 -0500)
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 <sage@redhat.com>
src/mon/OSDMonitor.cc

index 5e7a6003f2cb9ecbbc775be628faee86bcc56c83..0ba4dc8e42e23291fd7699810eae9d4cf398ff75 100644 (file)
@@ -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();