]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: add more wildcards support for scrub and fix description
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 3 Jul 2017 11:16:49 +0000 (19:16 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 6 Jul 2017 02:18:32 +0000 (10:18 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/mgr/DaemonServer.cc
src/mgr/MgrCommands.h
src/mon/OSDMonitor.cc

index afb156c728fd5d78fd0f6d6738a201bff4c9c6ea..e6b3100f09d88a0d8ce9ff4a2b0119ef102e997d 100644 (file)
@@ -635,7 +635,7 @@ bool DaemonServer::handle_command(MCommand *m)
     get_str_vec(prefix, pvec);
 
     set<int> osds;
-    if (whostr == "*") {
+    if (whostr == "*" || whostr == "all" || whostr == "any") {
       cluster_state.with_osdmap([&](const OSDMap& osdmap) {
          for (int i = 0; i < osdmap.get_max_osd(); i++)
            if (osdmap.is_up(i)) {
index 7df74d730fae51496e0aaff2abb863a9dccc462f..91886a2d2fe6df2fc532c0b697b4bf281ec46e9d 100644 (file)
@@ -100,10 +100,13 @@ COMMAND("osd test-reweight-by-pg " \
 
 COMMAND("osd scrub " \
        "name=who,type=CephString", \
-       "initiate scrub on osd <who>", "osd", "rw", "cli,rest")
+       "initiate scrub on osd <who>, or use <all|any|*> to scrub all", \
+        "osd", "rw", "cli,rest")
 COMMAND("osd deep-scrub " \
        "name=who,type=CephString", \
-       "initiate deep scrub on osd <who>", "osd", "rw", "cli,rest")
+       "initiate deep scrub on osd <who>, or use <all|any|*> to deep scrub all", \
+        "osd", "rw", "cli,rest")
 COMMAND("osd repair " \
        "name=who,type=CephString", \
-       "initiate repair on osd <who>", "osd", "rw", "cli,rest")
+       "initiate repair on osd <who>, or use <all|any|*> to repair all", \
+        "osd", "rw", "cli,rest")
index 8f5e12c04a3fd4b73e6bb243a956f84266bad733..200daa26b9f4b0935affaef4411da479023c3503 100644 (file)
@@ -4212,15 +4212,15 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
     }
     goto reply;
 
-  } else if ((prefix == "osd scrub" ||
-             prefix == "osd deep-scrub" ||
-             prefix == "osd repair")) {
+  } else if (prefix == "osd scrub" ||
+            prefix == "osd deep-scrub" ||
+            prefix == "osd repair") {
     string whostr;
     cmd_getval(g_ceph_context, cmdmap, "who", whostr);
     vector<string> pvec;
     get_str_vec(prefix, pvec);
 
-    if (whostr == "*") {
+    if (whostr == "*" || whostr == "all" || whostr == "any") {
       ss << "osds ";
       int c = 0;
       for (int i = 0; i < osdmap.get_max_osd(); i++)