[sheepdog] [PATCH 3/2] sheep: pass epoch to sheep_exec_req()

Liu Yuan namei.unix at gmail.com
Thu Jan 31 08:47:31 CET 2013


From: Liu Yuan <tailai.ly at taobao.com>

Let all the proceduers to enjoy retry.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/group.c    |    1 +
 sheep/recovery.c |    1 +
 sheep/store.c    |    1 +
 3 files changed, 3 insertions(+)

diff --git a/sheep/group.c b/sheep/group.c
index 2f05306..32ac85d 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -607,6 +607,7 @@ static int get_vdis_from(struct sd_node *node)
 	vc = xzalloc(rlen);
 	sd_init_req(&hdr, SD_OP_GET_VDI_COPIES);
 	hdr.data_length = rlen;
+	hdr.epoch = sys_epoch();
 	ret = sheep_exec_req(&node->nid, &hdr, (char *)vc);
 	if (ret != SD_RES_SUCCESS)
 		goto out;
diff --git a/sheep/recovery.c b/sheep/recovery.c
index 5595d73..c65bee3 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -523,6 +523,7 @@ retry:
 	sd_init_req((struct sd_req *)&hdr, SD_OP_GET_OBJ_LIST);
 	hdr.tgt_epoch = epoch - 1;
 	hdr.data_length = buf_size;
+	hdr.epoch = sys_epoch();
 	ret = sheep_exec_req(&e->nid, (struct sd_req *)&hdr, buf);
 
 	switch (ret) {
diff --git a/sheep/store.c b/sheep/store.c
index a8c70eb..8b9f1a9 100644
--- a/sheep/store.c
+++ b/sheep/store.c
@@ -99,6 +99,7 @@ int epoch_log_read_remote(uint32_t epoch, struct sd_node *nodes, int len)
 		sd_init_req(&hdr, SD_OP_GET_EPOCH);
 		hdr.data_length = len;
 		hdr.obj.tgt_epoch = epoch;
+		hdr.epoch = sys_epoch();
 		ret = sheep_exec_req(&local_nodes[i].nid, &hdr, nodes);
 		if (ret != SD_RES_SUCCESS)
 			continue;
-- 
1.7.9.5




More information about the sheepdog mailing list