]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: prevent set primary-affinity unless all OSDs support it
authorSage Weil <sage@inktank.com>
Fri, 7 Mar 2014 21:24:04 +0000 (13:24 -0800)
committerSage Weil <sage@inktank.com>
Fri, 7 Mar 2014 21:29:15 +0000 (13:29 -0800)
Make sure all running OSDs support the feature before we start using it
(even if the config option is on!).

Fixes: #7642
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/OSDMonitor.cc

index 72ee04d2145d5e985e558885b3c2dceb33314010..6dc4bed05c4299af8bd54c0bacfec92999bcc132 100644 (file)
@@ -4060,6 +4060,9 @@ bool OSDMonitor::prepare_command_impl(MMonCommand *m,
       err = -EPERM;
       goto reply;
     }
+    err = check_cluster_features(CEPH_FEATURE_OSD_PRIMARY_AFFINITY, ss);
+    if (err < 0)
+      goto reply;
     if (osdmap.exists(id)) {
       pending_inc.new_primary_affinity[id] = ww;
       ss << "set osd." << id << " primary-affinity to " << w << " (" << ios::hex << ww << ios::dec << ")";