From d1721a4f00a90be194e571ccd0ea19dc2266f0c6 Mon Sep 17 00:00:00 2001 From: Jimyeong Lee Date: Wed, 2 Aug 2023 09:17:07 +0900 Subject: [PATCH] client: Add tailing closing square bracket once in handle_command_reply Delete unnecessary method, Add multi_id to logs Signed-off-by: Jimyeong Lee --- src/client/Client.cc | 6 +++--- src/common/CommandTable.h | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 55aa1b415b8..2cc4a33a247 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -6403,7 +6403,7 @@ int Client::mds_command( op.con = conn; ldout(cct, 4) << __func__ << ": new command op to " << target_gid - << " tid=" << op.tid << cmd << dendl; + << " tid=" << op.tid << " multi_id=" << op.multi_target_id << " "<< cmd << dendl; // Construct and send MCommand MessageRef m = op.get_message(monclient->get_fsid()); @@ -6429,7 +6429,7 @@ void Client::handle_command_reply(const MConstRef& m) } auto &op = command_table.get_command(tid); - ceph_tid_t multi_id = command_table.get_multi_target_id(tid); + ceph_tid_t multi_id = op.multi_target_id; if (op.outbl) { if (multi_id != 0 && m->r == 0) { @@ -6452,7 +6452,7 @@ void Client::handle_command_reply(const MConstRef& m) } else { // when this command is the last one - if (command_table.count_multi_commands(multi_id) <= 1) { + if (command_table.count_multi_commands(multi_id) == 1) { op.outbl->append("]"); } } diff --git a/src/common/CommandTable.h b/src/common/CommandTable.h index cf57ee5e0ac..e777d72dcf5 100644 --- a/src/common/CommandTable.h +++ b/src/common/CommandTable.h @@ -122,11 +122,6 @@ public: return commands.at(tid); } - bool get_multi_target_id(ceph_tid_t tid) const - { - return commands.at(tid).multi_target_id; - } - void erase(ceph_tid_t tid) { ceph_tid_t multi_id = commands.at(tid).multi_target_id; -- 2.39.5