[sheepdog] [PATCH 1/9] sheep: don't try to recover from working directory

MORITA Kazutaka morita.kazutaka at gmail.com
Mon May 6 19:45:48 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 2ee1470..dc38dac 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -78,8 +78,11 @@ static int recover_object_from_replica(uint64_t oid,
 	void *buf = NULL;
 	struct siocb iocb = { 0 };
 
-	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