]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds,client: update the oldest_client_tid via the renew caps 54468/head
authorXiubo Li <xiubli@redhat.com>
Tue, 31 Oct 2023 02:23:09 +0000 (10:23 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 27 Mar 2024 04:19:57 +0000 (12:19 +0800)
Update the oldest_client_tid via the session renew caps msg to
make sure that the MDSs won't pile up the completed request list
in a very large size.

Fixes: https://tracker.ceph.com/issues/63364
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 0cff6d5d487972a850e7c64b1e3b8ca283bf3c03)

src/client/Client.cc
src/mds/Server.cc
src/messages/MClientSession.h

index db343c44cd648ebf3c149c2bfc0257804cc16ceb..0fc532f79c108b33bf6f2a77e7a71a3c06481c51 100644 (file)
@@ -7223,7 +7223,9 @@ void Client::renew_caps(MetaSession *session)
   ldout(cct, 10) << "renew_caps mds." << session->mds_num << dendl;
   session->last_cap_renew_request = ceph_clock_now();
   uint64_t seq = ++session->cap_renew_seq;
-  session->con->send_message2(make_message<MClientSession>(CEPH_SESSION_REQUEST_RENEWCAPS, seq));
+  auto m = make_message<MClientSession>(CEPH_SESSION_REQUEST_RENEWCAPS, seq);
+  m->oldest_client_tid = oldest_tid;
+  session->con->send_message2(std::move(m));
 }
 
 
index 27891d0c09373e0013f5757e642a68c88956d37b..fcd351bebfd664abc5b831d2c1dc1d44548e8bd9 100644 (file)
@@ -789,6 +789,7 @@ void Server::handle_client_session(const cref_t<MClientSession> &m)
        mds->locker->resume_stale_caps(session);
        mds->sessionmap.touch_session(session);
       }
+      trim_completed_request_list(m->oldest_client_tid, session);
       auto reply = make_message<MClientSession>(CEPH_SESSION_RENEWCAPS, m->get_seq());
       mds->send_message_client(reply, session);
     } else {
index 8f6e47acf1dfc8612fde1d399bbcc6e932ababdf..37b3fc1d0629e62e7233b201db70fab8fde22f47 100644 (file)
@@ -21,7 +21,7 @@
 
 class MClientSession final : public SafeMessage {
 private:
-  static constexpr int HEAD_VERSION = 6;
+  static constexpr int HEAD_VERSION = 7;
   static constexpr int COMPAT_VERSION = 1;
 
 public:
@@ -33,6 +33,7 @@ public:
   feature_bitset_t supported_features;
   metric_spec_t metric_spec;
   std::vector<MDSCapAuth> cap_auths;
+  ceph_tid_t oldest_client_tid = UINT64_MAX;
 
   int get_op() const { return head.op; }
   version_t get_seq() const { return head.seq; }
@@ -88,6 +89,9 @@ public:
     if (header.version >= 6) {
       decode(cap_auths, p);
     }
+    if (header.version >= 7) {
+      decode(oldest_client_tid, p);
+    }
   }
   void encode_payload(uint64_t features) override { 
     using ceph::encode;
@@ -104,6 +108,7 @@ public:
       encode(metric_spec, payload);
       encode(flags, payload);
       encode(cap_auths, payload);
+      encode(oldest_client_tid, payload);
     }
   }
 private: