]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Add retry field to MDRequest
authorSam Lang <sam.lang@inktank.com>
Tue, 12 Feb 2013 22:33:19 +0000 (16:33 -0600)
committerSage Weil <sage@inktank.com>
Tue, 12 Feb 2013 22:44:24 +0000 (14:44 -0800)
The MDRequest can be retried via the RetryRequest finisher,
we add a retry field that gets incremented before each
retry in the finisher.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/mds/MDCache.cc
src/mds/Mutation.h

index 2eb8220b3f8c9118ea083d02d02c649d908bf5ea..7d04563c78a61ceba403d86ae1c46e4b04d72dc1 100644 (file)
@@ -10582,6 +10582,7 @@ C_MDS_RetryRequest::C_MDS_RetryRequest(MDCache *c, MDRequest *r)
 
 void C_MDS_RetryRequest::finish(int r)
 {
+  mdr->retry++;
   cache->dispatch_request(mdr);
   mdr->put();
 }
index bb5f1f6febc690fc87b7514721c25b64dc82d99e..8866f6850c612415069c1c5732813f5fad7daa80 100644 (file)
@@ -188,6 +188,9 @@ struct MDRequest : public Mutation {
   // -- i am an internal op
   int internal_op;
 
+  // indicates how may retries of request have been made
+  int retry;
+
   // break rarely-used fields into a separately allocated structure 
   // to save memory for most ops
   struct More {
@@ -241,6 +244,7 @@ struct MDRequest : public Mutation {
     alloc_ino(0), used_prealloc_ino(0), snap_caps(0), did_early_reply(false),
     slave_request(0),
     internal_op(-1),
+    retry(0),
     _more(0) {
     in[0] = in[1] = 0; 
   }
@@ -252,6 +256,7 @@ struct MDRequest : public Mutation {
     alloc_ino(0), used_prealloc_ino(0), snap_caps(0), did_early_reply(false),
     slave_request(0),
     internal_op(-1),
+    retry(0),
     _more(0) {
     in[0] = in[1] = 0; 
   }
@@ -263,6 +268,7 @@ struct MDRequest : public Mutation {
     alloc_ino(0), used_prealloc_ino(0), snap_caps(0), did_early_reply(false),
     slave_request(0),
     internal_op(-1),
+    retry(0),
     _more(0) {
     in[0] = in[1] = 0; 
   }