]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds,client: update the oldest_client_tid via the renew caps 54259/head
authorXiubo Li <xiubli@redhat.com>
Tue, 31 Oct 2023 02:23:09 +0000 (10:23 +0800)
committerXiubo Li <xiubli@redhat.com>
Tue, 31 Oct 2023 04:27:35 +0000 (12:27 +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>
src/client/Client.cc
src/mds/Server.cc
src/messages/MClientSession.h

index 7d223018c76218cac2d8c4662849cbd42757bada..4a0cb61fd17a7d0ef6e5ad9986359f2b0042969b 100644 (file)
@@ -7254,7 +7254,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 dcd5daafc2510fcb03472286b3cfcd6d510f6915..cbcaf1a6b330a83be8841f42172a3ff662445d1a 100644 (file)
@@ -785,6 +785,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 1034707faacdaf96230a2a3af4580dcd69554b64..3e70370a52d9c90480bfb7bbe098c62b74e01dda 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: