From: MORITA Kazutaka <morita.kazut...@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.kazut...@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

-- 
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to