From 616fdd1ae394195a2628fef6f6808e035b71069d Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 18 Feb 2025 14:35:16 -0500 Subject: [PATCH] client: skip unexpected command replies Instead of marking the message as handled, give another component (or Client) a chance to process. Signed-off-by: Patrick Donnelly --- src/client/Client.cc | 12 ++++++++---- src/client/Client.h | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 51298d90a59a..374918a5c290 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -3131,8 +3131,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(m)); - return Dispatcher::HANDLED(); + if (handle_command_reply(ref_cast(m))) { + return Dispatcher::HANDLED(); + } else { + return Dispatcher::UNHANDLED(); + } } else { return Dispatcher::UNHANDLED(); } @@ -6686,7 +6689,7 @@ int Client::mds_command( return 0; } -void Client::handle_command_reply(const MConstRef& m) +bool Client::handle_command_reply(const MConstRef& m) { ceph_tid_t const tid = m->get_tid(); @@ -6695,7 +6698,7 @@ void Client::handle_command_reply(const MConstRef& 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); @@ -6736,6 +6739,7 @@ void Client::handle_command_reply(const MConstRef& m) } command_table.erase(tid); + return true; } // ------------------- diff --git a/src/client/Client.h b/src/client/Client.h index ac600f434b28..3fd3e9201e4b 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -983,7 +983,7 @@ protected: void set_cap_epoch_barrier(epoch_t e); - void handle_command_reply(const MConstRef& m); + bool handle_command_reply(const MConstRef& m); int fetch_fsmap(bool user); int resolve_mds( const std::string &mds_spec, -- 2.47.3