[sheepdog] [PATCH v3 02/10] sheep: don't try to recover from working directory
MORITA Kazutaka
morita.kazutaka at gmail.com
Thu May 9 12:15:36 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 | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/sheep/recovery.c b/sheep/recovery.c
index 46571b0..2f9fb22 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -104,9 +104,12 @@ 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);
- else {
+ if (vnode_is_local(vnode)) {
+ if (tgt_epoch < sys_epoch())
+ ret = sd_store->link(oid, tgt_epoch);
+ else
+ ret = SD_RES_NO_OBJ;
+ } else {
sd_init_req(&hdr, SD_OP_READ_PEER);
hdr.epoch = epoch;
hdr.flags = SD_FLAG_CMD_RECOVERY;
--
1.7.9.5
More information about the sheepdog
mailing list