From 3b520b5173d96db5ffc30ed31a92760f3910e733 Mon Sep 17 00:00:00 2001 From: Sam Lang Date: Mon, 25 Mar 2013 12:58:13 -0500 Subject: [PATCH] client: Handle duplicate safe replies If the mds sends a duplicate safe reply, the mds_requests map won't contain a matching request id (tid). Instead of assert failing, we log a message that we saw a reply without a matching request. Also remove redundant mds_requests->erase(tid) line. Signed-off-by: Sam Lang --- src/client/Client.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 6c90844c184..59f32ef3b74 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -1698,7 +1698,12 @@ void Client::handle_client_reply(MClientReply *reply) ldout(cct, 20) << "handle_client_reply got a reply. Safe:" << is_safe << " tid " << tid << dendl; MetaRequest *request = mds_requests[tid]; - assert(request); + if (!request) { + ldout(cct, 0) << "got an unknown reply (probably duplicate) on tid " << tid << " from mds " + << mds_num << " safe: " << is_safe << dendl; + reply->put(); + return; + } if (request->got_unsafe && !is_safe) { //duplicate response @@ -1756,7 +1761,6 @@ void Client::handle_client_reply(MClientReply *reply) request->unsafe_item.remove_myself(); } request->item.remove_myself(); - mds_requests.erase(tid); request->put(); // for the dumb data structure } if (unmounting) -- 2.47.3