]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: tidy up 'kill_session' naming
authorJohn Spray <john.spray@redhat.com>
Tue, 18 Apr 2017 20:34:47 +0000 (16:34 -0400)
committerJohn Spray <john.spray@redhat.com>
Tue, 23 May 2017 09:22:17 +0000 (05:22 -0400)
We had two kill_sessions.  Leave Server::kill_session (the
one that actually operates on MDS sessions only), and rename
the MDSRank one to evict_client, because it does more than
just kill the MDS session.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDSDaemon.cc
src/mds/MDSRank.cc
src/mds/MDSRank.h
src/mds/Server.cc

index 48c1b46551b71e6e6820045e50a0ef615a3227f1..68f7a984504b3234094e6e5e6632263bd1d5cba1 100644 (file)
@@ -774,8 +774,9 @@ int MDSDaemon::_handle_command(
     int64_t session_id = 0;
     bool got = cmd_getval(cct, cmdmap, "session_id", session_id);
     assert(got);
-    bool killed = mds_rank->kill_session(session_id, false,
-        g_conf->mds_session_blacklist_on_evict, ss);
+    bool killed = mds_rank->evict_client(session_id, false,
+                                         g_conf->mds_session_blacklist_on_evict,
+                                         ss);
     if (!killed)
       r = -ENOENT;
   } else if (prefix == "heap") {
index 2791f9487eff4d7082ff28b711f0662b64e9acf7..536350a99759ed67c8a67133a1ae4cbf978aaeea 100644 (file)
@@ -1877,9 +1877,9 @@ bool MDSRankDispatcher::handle_asok_command(
 
     mds_lock.Lock();
     std::stringstream dss;
-    bool killed = kill_session(strtol(client_id.c_str(), 0, 10), true,
+    bool evicted = evict_client(strtol(client_id.c_str(), 0, 10), true,
         g_conf->mds_session_blacklist_on_evict, dss);
-    if (!killed) {
+    if (!evicted) {
       dout(15) << dss.str() << dendl;
       ss << dss.str();
     }
@@ -1972,7 +1972,7 @@ public:
  * MDSRank after calling it (we could have gone into shutdown): just
  * send your result back to the calling client and finish.
  */
-void MDSRankDispatcher::evict_sessions(const SessionFilter &filter, MCommand *m)
+void MDSRankDispatcher::evict_clients(const SessionFilter &filter, MCommand *m)
 {
   C_MDS_Send_Command_Reply *reply = new C_MDS_Send_Command_Reply(this, m);
 
@@ -2007,8 +2007,8 @@ void MDSRankDispatcher::evict_sessions(const SessionFilter &filter, MCommand *m)
   C_GatherBuilder gather(g_ceph_context, reply);
   for (const auto s : victims) {
     std::stringstream ss;
-    kill_session(s->info.inst.name.num(), false,
-        g_conf->mds_session_blacklist_on_evict, ss, gather.new_sub());
+    evict_client(s->info.inst.name.num(), false,
+                 g_conf->mds_session_blacklist_on_evict, ss, gather.new_sub());
   }
   gather.activate();
 }
@@ -2636,7 +2636,7 @@ void MDSRankDispatcher::handle_osd_map()
   objecter->maybe_request_map();
 }
 
-bool MDSRank::kill_session(int64_t session_id,
+bool MDSRank::evict_client(int64_t session_id,
     bool wait, bool blacklist, std::stringstream& err_ss,
     Context *on_killed)
 {
@@ -2820,7 +2820,7 @@ bool MDSRankDispatcher::handle_command(
       return true;
     }
 
-    evict_sessions(filter, m);
+    evict_clients(filter, m);
 
     *need_reply = false;
     return true;
index 5fae1b43e9fee424472c427a93e5a661030c4f8d..e8ec9dc07c2a39f8acd6cd85bdc979c3a544a5cb 100644 (file)
@@ -406,7 +406,7 @@ class MDSRank {
       return map_targets.count(rank);
     }
 
-    bool kill_session(int64_t session_id, bool wait, bool blacklist,
+    bool evict_client(int64_t session_id, bool wait, bool blacklist,
                       std::stringstream& ss, Context *on_killed=nullptr);
 
   protected:
@@ -549,7 +549,7 @@ public:
     bool *need_reply);
 
   void dump_sessions(const SessionFilter &filter, Formatter *f) const;
-  void evict_sessions(const SessionFilter &filter, MCommand *m);
+  void evict_clients(const SessionFilter &filter, MCommand *m);
 
   // Call into me from MDS::ms_dispatch
   bool ms_dispatch(Message *m);
index edbe9e51f1f11f91e8969e4749afd960194da415..7d48420209e9f2430c4366770c0b760a031efda3 100644 (file)
@@ -760,8 +760,8 @@ void Server::find_idle_sessions()
 
     if (g_conf->mds_session_blacklist_on_timeout) {
       std::stringstream ss;
-      mds->kill_session(session->info.inst.name.num(), false, true,
-          ss, nullptr);
+      mds->evict_client(session->info.inst.name.num(), false, true,
+                        ss, nullptr);
     } else {
       kill_session(session, NULL);
     }
@@ -1025,7 +1025,8 @@ void Server::reconnect_tick()
 
       if (g_conf->mds_session_blacklist_on_timeout) {
         std::stringstream ss;
-        mds->kill_session(session->info.inst.name.num(), false, true, ss, gather.new_sub());
+        mds->evict_client(session->info.inst.name.num(), false, true, ss,
+                          gather.new_sub());
       } else {
         kill_session(session, NULL);
       }