]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: use 'mds set inline_data ...' for enable/disable of inline data
authorSage Weil <sage@inktank.com>
Sun, 2 Feb 2014 20:02:08 +0000 (12:02 -0800)
committerSage Weil <sage@inktank.com>
Tue, 4 Feb 2014 01:50:32 +0000 (17:50 -0800)
This makes the management interface a bit more consistent.

Signed-off-by: Sage Weil <sage@inktank.com>
qa/workunits/cephtool/test.sh
src/mon/MDSMonitor.cc
src/mon/MonCommands.h

index 0e61f9feb74a98c126ce3395d5091792feb9fbef..58d0e94a5214ab42e201c20fd912bff75f45c0cc 100755 (executable)
@@ -160,6 +160,15 @@ ceph mds set_max_mds 4
 ceph mds set_max_mds 3
 ceph mds set max_mds 4
 expect_false ceph mds set max_mds asdf
+expect_false ceph mds set inline_data true
+ceph mds set inline_data true --yes-i-really-mean-it
+ceph mds set inline_data yes --yes-i-really-mean-it
+ceph mds set inline_data 1 --yes-i-really-mean-it
+expect_false ceph mds set inline_data --yes-i-really-mean-it
+ceph mds set inline_data false
+ceph mds set inline_data no
+ceph mds set inline_data 0
+expect_false ceph mds set inline_data asdf
 ceph mds set max_file_size 1000000000
 expect_false ceph mds set max_file_size 123asdf
 
index e24b1d01d1b91f2b0dea073e6c8e02123778cee0..0f7bf274eb4591eb8df5ad941d43f75a05de085c 100644 (file)
@@ -842,6 +842,27 @@ bool MDSMonitor::prepare_command(MMonCommand *m)
       if (interr.length())
        goto out;
       pending_mdsmap.max_mds = n;
+    } else if (var == "inline_data") {
+      if (val == "true" || val == "yes" || (!interr.length() && n == 1)) {
+       string confirm;
+       if (!cmd_getval(g_ceph_context, cmdmap, "confirm", confirm) ||
+           confirm != "--yes-i-really-mean-it") {
+         ss << "inline data is new and experimental; you must specify --yes-i-really-mean-it";
+         r = -EPERM;
+         goto out;
+       }
+       ss << "inline data enabled";
+       pending_mdsmap.set_inline_data_enabled(true);
+       pending_mdsmap.compat.incompat.insert(MDS_FEATURE_INCOMPAT_INLINE);
+      } else if (val == "false" || val == "no" ||
+                (!interr.length() && n == 0)) {
+       ss << "inline data disabled";
+       pending_mdsmap.set_inline_data_enabled(false);
+      } else {
+       ss << "value must be false|no|0 or true|yes|1";
+       r = -EINVAL;
+       goto out;
+      }
     } else if (var == "max_file_size") {
       if (interr.length()) {
        ss << var << " requires an integer value";
@@ -994,13 +1015,6 @@ bool MDSMonitor::prepare_command(MMonCommand *m)
       r = 0;
     }
 
-  } else if (prefix == "mds inline enable") {
-    pending_mdsmap.set_inline_data_enabled(true);
-    pending_mdsmap.compat.incompat.insert(MDS_FEATURE_INCOMPAT_INLINE);
-    r = 0;
-  } else if (prefix == "mds inline disable") {
-    pending_mdsmap.set_inline_data_enabled(false);
-    r = 0;
   } else if (prefix == "mds add_data_pool") {
     string poolname;
     cmd_getval(g_ceph_context, cmdmap, "pool", poolname);
index de84997db5596804449ec59f586194a34571c624..bff1f2e7b5aeece54d2dde7f6a99b62620c07990 100644 (file)
@@ -249,7 +249,7 @@ COMMAND("mds set_max_mds " \
        "name=maxmds,type=CephInt,range=0", \
        "set max MDS index", "mds", "rw", "cli,rest")
 COMMAND("mds set " \
-       "name=var,type=CephChoices,strings=max_mds|max_file_size|allow_new_snaps " \
+       "name=var,type=CephChoices,strings=max_mds|max_file_size|allow_new_snaps|inline_data " \
        "name=val,type=CephString "                                     \
        "name=confirm,type=CephString,req=false",                       \
        "set mds parameter <var> to <val>", "mds", "rw", "cli,rest")
@@ -279,12 +279,6 @@ COMMAND("mds compat rm_compat " \
 COMMAND("mds compat rm_incompat " \
        "name=feature,type=CephInt,range=0", \
        "remove incompatible feature", "mds", "rw", "cli,rest")
-COMMAND("mds inline enable", \
-        "enable inline data feature", \
-        "mds", "rw", "cli,rest")
-COMMAND("mds inline disable", \
-        "disable inline data feature", \
-        "mds", "rw", "cli,rest")
 COMMAND("mds add_data_pool " \
        "name=pool,type=CephString", \
        "add data pool <pool>", "mds", "rw", "cli,rest")