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 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

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

Reply via email to