From 1bbe6bbc29757cb8a0f4afb87d20346fa564bd33 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Thu, 13 Jan 2022 12:03:39 +0800 Subject: [PATCH] client: do nothing when get a stale reply In theory when we get a stale reply from incorrect session, that means it's buggy in MDS. Anyway we should discard it without doing anything. Signed-off-by: Xiubo Li --- src/client/Client.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client/Client.cc b/src/client/Client.cc index 471ce3f8e3d3..571b9fcb913f 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -2665,6 +2665,13 @@ void Client::handle_client_reply(const MConstRef& reply) ldout(cct, 20) << __func__ << " got a reply. Safe:" << is_safe << " tid " << tid << dendl; + // correct sessions ? + if (request->mds != mds_num) { + ldout(cct, 0) << "got a stale reply from mds." << mds_num + << " instead of mds." << request->mds << dendl; + return; + } + if (request->got_unsafe && !is_safe) { //duplicate response ldout(cct, 0) << "got a duplicate reply on tid " << tid << " from mds " -- 2.47.3