[sheepdog] [PATCH] sheep: no need to wait for nr_objs of an object

levin li levin108 at gmail.com
Thu Nov 29 10:17:00 CET 2012


From: levin li <xingke.lwp at taobao.com>

Since we've notified the nr_objs of a newly creately VDI before
the VDI objects are created, we can always get the nr_objs by
get_obj_copy_number(), I leave the error message undeleted for later
debug in case there's an error we haven't noticed.

Signed-off-by: levin li <xingke.lwp at taobao.com>
---
 sheep/recovery.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/sheep/recovery.c b/sheep/recovery.c
index 9c5c712..726d4b8 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -539,17 +539,11 @@ static void screen_object_list(struct recovery_work *rw,
 	int i, j;
 
 	for (i = 0; i < nr_oids; i++) {
-again:
 		nr_objs = get_obj_copy_number(oids[i], rw->cur_vinfo->nr_zones);
 		if (!nr_objs) {
-			dprintf("can not find copy number for object %" PRIx64
-				"\n", oids[i]);
-			dprintf("probably, vdi was created but "
-				"post_cluster_new_vdi() is not called yet\n");
-			/* FIXME: can we wait for post_cluster_new_vdi
-			 *        with a better way? */
-			sleep(1);
-			goto again;
+			dprintf("ERROR: can not find copy number for object %"
+				PRIx64 "\n", oids[i]);
+			continue;
 		}
 		oid_to_vnodes(rw->cur_vinfo->vnodes, rw->cur_vinfo->nr_vnodes,
 			      oids[i], nr_objs, vnodes);
-- 
1.7.1




More information about the sheepdog mailing list