]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: Handle duplicate safe replies
authorSam Lang <sam.lang@inktank.com>
Mon, 25 Mar 2013 17:58:13 +0000 (12:58 -0500)
committerSam Lang <sam.lang@inktank.com>
Tue, 26 Mar 2013 14:25:18 +0000 (09:25 -0500)
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 <sam.lang@inktank.com>
src/client/Client.cc

index 6c90844c1846e6612aa7005d68656c8eec4f3ed5..59f32ef3b746c671b3b9a88f25f21dee3a9c4711 100644 (file)
@@ -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)