If node membership changes between process_work and process_main of SD_OP_NEW_VDI, we cannot get the vdi copies in recovery process. In that case, we need to wait for post_cluster_new_vdi to finish.
Signed-off-by: MORITA Kazutaka <morita.kazut...@lab.ntt.co.jp> --- sheep/recovery.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/sheep/recovery.c b/sheep/recovery.c index e5a41c3..4df5b66 100644 --- a/sheep/recovery.c +++ b/sheep/recovery.c @@ -548,11 +548,17 @@ 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]); - continue; + 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; } oid_to_vnodes(rw->cur_vinfo->vnodes, rw->cur_vinfo->nr_vnodes, oids[i], nr_objs, vnodes); -- 1.7.2.5 -- sheepdog mailing list sheepdog@lists.wpkg.org http://lists.wpkg.org/mailman/listinfo/sheepdog