]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: make timeout parameter optional for "cache drop" 24468/head
authorVenky Shankar <vshankar@redhat.com>
Thu, 11 Oct 2018 06:26:29 +0000 (02:26 -0400)
committerVenky Shankar <vshankar@redhat.com>
Tue, 6 Nov 2018 11:43:50 +0000 (17:13 +0530)
Fixes: http://tracker.ceph.com/issues/36695
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit 73459619747046d38df5f4ec6707db12dce77317)

 Conflicts:
src/mds/MDSDaemon.cc

src/mds/MDSDaemon.cc
src/mds/MDSRank.cc

index 1571fa4d968901f8b22d844c0791cdb19ece1c81..c444c5e533f20d71f1b70d54aa6349c1430315f7 100644 (file)
@@ -252,7 +252,7 @@ void MDSDaemon::set_up_admin_socket()
                                      "show cache status");
   assert(r == 0);
   r = admin_socket->register_command("cache drop",
-                                     "cache drop name=timeout,type=CephInt,range=1",
+                                     "cache drop name=timeout,type=CephInt,range=0,req=false",
                                      asok_hook,
                                      "drop cache");
   assert(r == 0);
@@ -653,7 +653,6 @@ void MDSDaemon::handle_command(MCommand *m)
   m->put();
 }
 
-
 struct MDSCommand {
   string cmdstring;
   string helpstring;
@@ -707,7 +706,7 @@ COMMAND("heap " \
        "name=heapcmd,type=CephChoices,strings=dump|start_profiler|stop_profiler|release|stats", \
        "show heap usage info (available only if compiled with tcmalloc)", \
        "mds", "*", "cli,rest")
-COMMAND("cache drop name=timeout,type=CephInt,range=1", "trim cache and optionally "
+COMMAND("cache drop name=timeout,type=CephInt,range=0,req=false", "trim cache and optionally "
        "request client to release all caps and flush the journal", "mds",
        "r", "cli,rest")
 };
index b81017a748aa8718fe218b5c8edc225687548235..ce82e3707e568c90b08346ec9670f109ee08fa04 100644 (file)
@@ -279,6 +279,10 @@ private:
     }
 
     void start_timer() {
+      if (!timeout) {
+        return;
+      }
+
       timer_task = new FunctionContext([this](int _) {
           timer_task = nullptr;
           complete(-ETIMEDOUT);
@@ -2397,7 +2401,7 @@ bool MDSRankDispatcher::handle_asok_command(
   } else if (command == "cache drop") {
     int64_t timeout;
     if (!cmd_getval(g_ceph_context, cmdmap, "timeout", timeout)) {
-      return false;
+      timeout = 0;
     }
 
     C_SaferCond cond;
@@ -3235,7 +3239,7 @@ bool MDSRankDispatcher::handle_command(
   } else if (prefix == "cache drop") {
     int64_t timeout;
     if (!cmd_getval(g_ceph_context, cmdmap, "timeout", timeout)) {
-      return false;
+      timeout = 0;
     }
 
     JSONFormatter *f = new JSONFormatter(true);