[Sheepdog] [PATCH v2] sheep: need not read many copies of bitmap

Liu Yuan namei.unix at gmail.com
Thu May 10 09:23:49 CEST 2012


On 05/10/2012 03:12 PM, yaohaiting.wujue at gmail.com wrote:

> From: HaiTing Yao <wujue.yht at taobao.com>
> 
> Node maybe need read all of the bitmaps when the epoch is not zero. This
> perhaps occurs when we restart the shutdown cluster or join one once
> existed node.
> 
> Usually, node need not read many copies of bitmap. If the cluster status
> is OK and the node status is waiting for format, node just need read one
> bitamp.
> 
> Signed-off-by: HaiTing Yao <wujue.yht at taobao.com>
> ---
>  sheep/group.c |   10 +++++++---
>  1 files changed, 7 insertions(+), 3 deletions(-)
> 
> changes from v1:
> 
> After cluster shutdown, need read all copies
> 
> diff --git a/sheep/group.c b/sheep/group.c
> index c7fd387..d09563b 100644
> --- a/sheep/group.c
> +++ b/sheep/group.c
> @@ -720,9 +720,13 @@ static void __sd_join(struct event_struct *cevent)
>  	if (sys_stat_ok())
>  		return;
>  
> -	get_vdi_bitmap_from_sd_list();
> -	for (i = 0; i < w->member_list_entries; i++)
> -		get_vdi_bitmap_from(w->member_list + i);
> +	if (sys_stat_wait_format())


I guess this patch means to accelerate the new node joining into a
already running cluster, let's comment it in the code explicitly too.

Thanks,
Yuan

> +		get_vdi_bitmap_from(w->member_list);
> +	else {
> +		get_vdi_bitmap_from_sd_list();
> +		for (i = 0; i < w->member_list_entries; i++)
> +			get_vdi_bitmap_from(w->member_list + i);
> +	}
>  }
>  
>  static void __sd_leave(struct event_struct *cevent)





More information about the sheepdog mailing list