]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: require OSD_CACHEPOOL feature before using tiering features
authorSage Weil <sage@inktank.com>
Thu, 27 Mar 2014 23:39:01 +0000 (16:39 -0700)
committerSage Weil <sage@inktank.com>
Thu, 27 Mar 2014 23:39:01 +0000 (16:39 -0700)
The OSDs need to support this feature before we allow users to turn it
on.  This is similar to what the erasure pool support does.

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

index be55befdd341d7dd70e683beedfa1807cb9b5c35..b721ddd83c2f91fdd02b02b735134455ecf0988d 100644 (file)
@@ -4756,6 +4756,11 @@ done:
                                                   get_last_committed() + 1));
     return true;
   } else if (prefix == "osd tier add") {
+    err = check_cluster_features(CEPH_FEATURE_OSD_CACHEPOOL, ss);
+    if (err == -EAGAIN)
+      goto wait;
+    if (err)
+      goto reply;
     string poolstr;
     cmd_getval(g_ceph_context, cmdmap, "pool", poolstr);
     int64_t pool_id = osdmap.lookup_pg_pool_name(poolstr);
@@ -4864,6 +4869,11 @@ done:
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "osd tier set-overlay") {
+    err = check_cluster_features(CEPH_FEATURE_OSD_CACHEPOOL, ss);
+    if (err == -EAGAIN)
+      goto wait;
+    if (err)
+      goto reply;
     string poolstr;
     cmd_getval(g_ceph_context, cmdmap, "pool", poolstr);
     int64_t pool_id = osdmap.lookup_pg_pool_name(poolstr);
@@ -4930,6 +4940,11 @@ done:
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "osd tier cache-mode") {
+    err = check_cluster_features(CEPH_FEATURE_OSD_CACHEPOOL, ss);
+    if (err == -EAGAIN)
+      goto wait;
+    if (err)
+      goto reply;
     string poolstr;
     cmd_getval(g_ceph_context, cmdmap, "pool", poolstr);
     int64_t pool_id = osdmap.lookup_pg_pool_name(poolstr);
@@ -4961,6 +4976,11 @@ done:
                                              get_last_committed() + 1));
     return true;
   } else if (prefix == "osd tier add-cache") {
+    err = check_cluster_features(CEPH_FEATURE_OSD_CACHEPOOL, ss);
+    if (err == -EAGAIN)
+      goto wait;
+    if (err)
+      goto reply;
     string poolstr;
     cmd_getval(g_ceph_context, cmdmap, "pool", poolstr);
     int64_t pool_id = osdmap.lookup_pg_pool_name(poolstr);