]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/OSDMonitor: allow 'osd require-osd-release octopus'
authorSage Weil <sage@redhat.com>
Fri, 22 Mar 2019 22:30:11 +0000 (17:30 -0500)
committerSage Weil <sage@redhat.com>
Tue, 2 Apr 2019 21:19:43 +0000 (16:19 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
qa/workunits/mon/crush_ops.sh
src/mon/MonCommands.h
src/mon/OSDMonitor.cc

index 4ad8f3544b6e07a20e1dd74a33c446d41c50e341..a68761985468f504019e1acc6a27ae32ad59fab8 100755 (executable)
@@ -19,8 +19,6 @@ ceph osd crush rule create-simple foo default host
 ceph osd crush rule create-simple foo default host
 ceph osd crush rule create-simple bar default host
 
-# make sure we're at luminous+ before using crush device classes
-ceph osd require-osd-release nautilus
 ceph osd crush rm-device-class all
 ceph osd crush set-device-class ssd osd.0
 ceph osd crush set-device-class hdd osd.1
index 62d1b244c261d2e381906f17ff6544aaad963f1e..fe701babc6dfa7a90d6e8b77802c8d6d541364c8 100644 (file)
@@ -793,7 +793,7 @@ COMMAND("osd unset " \
        "notieragent|nosnaptrim", \
        "unset <key>", "osd", "rw")
 COMMAND("osd require-osd-release "\
-       "name=release,type=CephChoices,strings=luminous|mimic|nautilus " \
+       "name=release,type=CephChoices,strings=luminous|mimic|nautilus|octopus " \
         "name=yes_i_really_mean_it,type=CephBool,req=false", \
        "set the minimum allowed OSD release to participate in the cluster",
        "osd", "rw")
index c62932f1e0e49e61df17b145a6e7499d6886be07..5b7f3b98e435d20cdacd18d7be0eafb7b74453af 100644 (file)
@@ -10365,6 +10365,19 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
        err = -EPERM;
        goto reply;
       }
+    } else if (rel == CEPH_RELEASE_OCTOPUS) {
+      if (!mon->monmap->get_required_features().contains_all(
+           ceph::features::mon::FEATURE_OCTOPUS)) {
+       ss << "not all mons are octopus";
+       err = -EPERM;
+       goto reply;
+      }
+      if ((!HAVE_FEATURE(osdmap.get_up_osd_features(), SERVER_OCTOPUS))
+           && !sure) {
+       ss << "not all up OSDs have CEPH_FEATURE_SERVER_OCTOPUS feature";
+       err = -EPERM;
+       goto reply;
+      }
     } else {
       ss << "not supported for this release yet";
       err = -EPERM;