]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix replay/resent vs completed request check
authorSage Weil <sage@newdream.net>
Sun, 12 Dec 2010 22:39:48 +0000 (14:39 -0800)
committerSage Weil <sage@newdream.net>
Sun, 12 Dec 2010 22:40:05 +0000 (14:40 -0800)
If it is a _replayed_ request, we should always send a simple ack if it is
completed, because the client doesn't not care about any additional caps.

If it is a _resent_ request, then we want to return useful caps on open or
create requests, even if any modification side-effects have already been
committed.  The additional checks for completed already exist in the
create and open handlers.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/Server.cc

index effca20a9597f15085d105b1d96ebb9034146b06..35af027dc6ea294f7e0b079f2a5b0db458b98102 100644 (file)
@@ -1061,10 +1061,11 @@ void Server::handle_client_request(MClientRequest *req)
     // they have a high request rate.
   }
 
-  // retry?
-  if ((req->get_retry_attempt() || req->is_replay()) &&
-      ((req->get_op() != CEPH_MDS_OP_OPEN) && 
-       (req->get_op() != CEPH_MDS_OP_CREATE))) {
+  // completed request?
+  if (req->is_replay() ||
+      (req->get_retry_attempt() &&
+       req->get_op() != CEPH_MDS_OP_OPEN && 
+       req->get_op() != CEPH_MDS_OP_CREATE)) {
     assert(session);
     if (session->have_completed_request(req->get_reqid().tid)) {
       dout(5) << "already completed " << req->get_reqid() << dendl;
@@ -1077,6 +1078,7 @@ void Server::handle_client_request(MClientRequest *req)
       return;
     }
   }
+
   // trim completed_request list
   if (req->get_oldest_client_tid() > 0) {
     dout(15) << " oldest_client_tid=" << req->get_oldest_client_tid() << dendl;