]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: consider max age of dispatch queue when finding stale client 22999/head
authorYan, Zheng <zyan@redhat.com>
Thu, 12 Jul 2018 02:52:57 +0000 (10:52 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 6 Aug 2018 03:31:55 +0000 (11:31 +0800)
session renew messages from clients can be in the dispatch queue,
waiting for getting dispatched.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/MDSRank.cc
src/mds/MDSRank.h
src/mds/Server.cc

index 4f056de08952893a2d230c92d3e78efd92e3fec5..fcf5452c2dea7502d9791d36e22a6834e7fea5aa 100644 (file)
@@ -1075,6 +1075,11 @@ utime_t MDSRank::get_laggy_until() const
   return beacon.get_laggy_until();
 }
 
+double MDSRank::get_dispatch_queue_max_age(utime_t now) const
+{
+  return messenger->get_dispatch_queue_max_age(now);
+}
+
 bool MDSRank::is_daemon_stopping() const
 {
   return stopping;
index dd6fba923deac495abebf24f74660c2024af4bf2..f2ab258a4fe21c9b6a89bab3fb6e2abf610abe5b 100644 (file)
@@ -367,6 +367,7 @@ class MDSRank {
     void damaged_unlocked();
 
     utime_t get_laggy_until() const;
+    double get_dispatch_queue_max_age(utime_t now) const;
 
     void send_message_mds(Message *m, mds_rank_t mds);
     void forward_message_mds(Message *req, mds_rank_t mds);
index f7a9fe7b6dbb64e50a76f7a6831cc905d348e5da..722ce887011d4b256f73e80ace71d8af3beea94f 100644 (file)
@@ -756,7 +756,10 @@ void Server::find_idle_sessions()
   // timeout/stale
   //  (caps go stale, lease die)
   utime_t now = ceph_clock_now();
+  double queue_max_age = mds->get_dispatch_queue_max_age(now);
+
   utime_t cutoff = now;
+  cutoff -= queue_max_age;
   cutoff -= mds->mdsmap->get_session_timeout();
   while (1) {
     Session *session = mds->sessionmap.get_oldest_session(Session::STATE_OPEN);
@@ -778,6 +781,7 @@ void Server::find_idle_sessions()
 
   // autoclose
   cutoff = now;
+  cutoff -= queue_max_age;
   cutoff -= mds->mdsmap->get_session_autoclose();
 
   // don't kick clients if we've been laggy