From d8c6b08e8e85f10069f379362b0afc2238e4c650 Mon Sep 17 00:00:00 2001 From: Sam Lang Date: Tue, 12 Feb 2013 16:33:19 -0600 Subject: [PATCH] mds: Add retry field to MDRequest 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 Reviewed-by: Sage Weil --- src/mds/MDCache.cc | 1 + src/mds/Mutation.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 2eb8220b3f8c9..7d04563c78a61 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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(); } diff --git a/src/mds/Mutation.h b/src/mds/Mutation.h index bb5f1f6febc69..8866f6850c612 100644 --- a/src/mds/Mutation.h +++ b/src/mds/Mutation.h @@ -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; } -- 2.39.5