]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: skip unexpected command replies
authorPatrick Donnelly <pdonnell@ibm.com>
Tue, 18 Feb 2025 19:35:16 +0000 (14:35 -0500)
committerPatrick Donnelly <pdonnell@ibm.com>
Mon, 17 Mar 2025 19:43:23 +0000 (15:43 -0400)
Instead of marking the message as handled, give another component (or Client) a
chance to process.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
(cherry picked from commit 616fdd1ae394195a2628fef6f6808e035b71069d)

src/client/Client.cc
src/client/Client.h

index ef8a640a9e854bcc418695f3685018d35425b1ac..d0d60a2735c3a70b475d335ab6418a29563886bf 100644 (file)
@@ -3116,8 +3116,11 @@ Dispatcher::dispatch_result_t Client::ms_dispatch2(const MessageRef &m)
     break;
   case MSG_COMMAND_REPLY:
     if (m->get_source().type() == CEPH_ENTITY_TYPE_MDS) {
-      handle_command_reply(ref_cast<MCommandReply>(m));
-      return Dispatcher::HANDLED();
+      if (handle_command_reply(ref_cast<MCommandReply>(m))) {
+        return Dispatcher::HANDLED();
+      } else {
+        return Dispatcher::UNHANDLED();
+      }
     } else {
       return Dispatcher::UNHANDLED();
     }
@@ -6676,7 +6679,7 @@ int Client::mds_command(
   return 0;
 }
 
-void Client::handle_command_reply(const MConstRef<MCommandReply>& m)
+bool Client::handle_command_reply(const MConstRef<MCommandReply>& m)
 {
   ceph_tid_t const tid = m->get_tid();
 
@@ -6685,7 +6688,7 @@ void Client::handle_command_reply(const MConstRef<MCommandReply>& m)
   std::scoped_lock cmd_lock(command_lock);
   if (!command_table.exists(tid)) {
     ldout(cct, 1) << __func__ << ": unknown tid " << tid << ", dropping" << dendl;
-    return;
+    return false;
   }
 
   auto &op = command_table.get_command(tid);
@@ -6726,6 +6729,7 @@ void Client::handle_command_reply(const MConstRef<MCommandReply>& m)
   }
 
   command_table.erase(tid);
+  return true;
 }
 
 // -------------------
index 76b9a1d8ea4ec959b1822efc397d4b5753d365b2..3c26b0a86c2245c3f392a939883124cb343fdf7c 100644 (file)
@@ -980,7 +980,7 @@ protected:
 
   void set_cap_epoch_barrier(epoch_t e);
 
-  void handle_command_reply(const MConstRef<MCommandReply>& m);
+  bool handle_command_reply(const MConstRef<MCommandReply>& m);
   int fetch_fsmap(bool user);
   int resolve_mds(
       const std::string &mds_spec,