[sheepdog] [PATCH v2 4/5] sheep/md: change the method of generating vnodes in md

Liu Yuan namei.unix at gmail.com
Fri May 9 10:13:21 CEST 2014


On Wed, May 07, 2014 at 06:25:41PM +0800, Robin Dong wrote:
> From: Robin Dong <sanbai at taobao.com>
> 
> Because the method of generating vnodes in cluster is changed, the
> method of generating vnodes in md should changed also.
> 
> After changing generate item from nodes to disks, adding new disk
> or removing old disk should also cause whole cluster to do recovery.
> 
> Signed-off-by: Robin Dong <sanbai at taobao.com>
> ---
>  sheep/group.c | 28 +++++++++++++++++++++++++++-
>  sheep/md.c    | 32 ++++++++++++++++++++++++++++----
>  2 files changed, 55 insertions(+), 5 deletions(-)
> 
> diff --git a/sheep/group.c b/sheep/group.c
> index efb47fb..d72ba39 100644
> --- a/sheep/group.c
> +++ b/sheep/group.c
> @@ -638,6 +638,32 @@ void wait_get_vdis_done(void)
>  	sd_debug("vdi list ready");
>  }
>  
> +static bool nodes_changed(const struct cluster_info *cinfo,
> +			  const struct rb_root *nroot,
> +			  size_t nr_nodes)

Better name it as membership_changed since both node and disk can be the ring
member.

Thanks
Yuan



More information about the sheepdog mailing list