[sheepdog] [PATCH v2 11/11] sheep: bump SD_MAX_NODES from 1024 to 6144

MORITA Kazutaka morita.kazutaka at gmail.com
Wed Sep 18 19:48:29 CEST 2013


At Sat, 14 Sep 2013 18:34:31 +0800,
Liu Yuan wrote:
> 
> This actually means we can support SD_MAX_NODES with zookeeper driver.
> 
> For simplicity, local and corosync drivers support at most 1024 nodes.
> 
> We are still tied to a fixed number sheepdog can support, but now with a much
> larger value.
> 
> The real limit is determined by the cluster driver with the current node
> management code, that is, how much payload of broadcast message the driver can
> send determined SD_MAX_NODES.
> 
> With 6144(6*1024), zookeeper's largest message is 983080 bytes, close to 1M that
> is its max allowed message size. This means we can actually increase
> SD_MAX_NODES beyound 6144 a little bit.
> 
> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> ---
>  include/internal_proto.h  |   14 ++++++++++++--
>  sheep/cluster/zookeeper.c |   10 ++++++++--
>  sheep/group.c             |   22 ++++++++++++++++++----
>  3 files changed, 38 insertions(+), 8 deletions(-)
> 
> diff --git a/include/internal_proto.h b/include/internal_proto.h
> index c02e066..db70a6c 100644
> --- a/include/internal_proto.h
> +++ b/include/internal_proto.h
> @@ -28,7 +28,7 @@
>  #define SD_DEFAULT_COPIES 3
>  #define SD_MAX_COPIES 8
>  
> -#define SD_MAX_NODES 1024
> +#define SD_MAX_NODES 6144
>  #define SD_DEFAULT_VNODES 128
>  
>  /*
> @@ -150,7 +150,17 @@ struct cluster_info {
>  	uint32_t __pad;
>  	uint8_t store[STORE_LEN];
>  
> -	/* node list at cluster_info->epoch */
> +	/*
> +	 * Node list at cluster_info->epoch
> +	 *
> +	 * The max number of nodes sheep daemon can support is constrained by
> +	 * the number of nodes in the struct cluster_info, but the actual max
> +	 * number is determined by the cluster driver because we have to pass
> +	 * sys->cinfo around the cluster to handle membership management.
> +	 *
> +	 * Currently, only zookeeper driver support SD_MAX_NODES nodes because
> +	 * its message buffer size is large enough to hold nodes[SD_MAX_NODES].
> +	 */

I think this explanation should be placed where SD_MAX_NODES is defined.

Thanks,

Kazutaka



More information about the sheepdog mailing list