[sheepdog] [PATCH v2 02/10] sheep: don't try to recover from working directory

MORITA Kazutaka morita.kazutaka at gmail.com
Thu May 9 04:38:51 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

It is obvious that sheep doesn't have the object in the working
directory.  In this case, recover_object_from_replica() should return
SD_RES_NO_OBJ and try the next node asap.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/recovery.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sheep/recovery.c b/sheep/recovery.c
index 1429391..bf54b63 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -109,8 +109,11 @@ static int recover_object_from_replica(uint64_t oid, struct vnode_info *old,
 		if (is_invalid_vnode(vnode, cur->nodes, cur->nr_nodes))
 			continue;
 
-		if (vnode_is_local(vnode) && tgt_epoch < sys_epoch()) {
-			ret = sd_store->link(oid, tgt_epoch);
+		if (vnode_is_local(vnode)) {
+			if (tgt_epoch < sys_epoch())
+				ret = sd_store->link(oid, tgt_epoch);
+			else
+				ret = SD_RES_NO_OBJ;
 			goto out;
 		}
 
-- 
1.7.9.5




More information about the sheepdog mailing list