[sheepdog] [PATCH] recvoery: don't do recovery when it's a gateway only node
Liu Yuan
namei.unix at gmail.com
Tue Jul 17 03:57:12 CEST 2012
On 07/16/2012 05:51 PM, Liu Yuan wrote:
> From: Liu Yuan <tailai.ly at taobao.com>
>
>
> Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
> ---
> sheep/recovery.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/sheep/recovery.c b/sheep/recovery.c
> index 444e99f..dd17edd 100644
> --- a/sheep/recovery.c
> +++ b/sheep/recovery.c
> @@ -584,10 +584,18 @@ out:
> free(buf);
> }
>
> +static inline bool node_is_gateway_only(void)
> +{
> + return sys->this_node.nr_vnodes == 0 ? true : false;
> +}
> +
> int start_recovery(struct vnode_info *cur_vnodes, struct vnode_info *old_vnodes)
> {
> struct recovery_work *rw;
>
> + if (node_is_gateway_only())
> + return 0;
> +
> rw = zalloc(sizeof(struct recovery_work));
> if (!rw) {
> eprintf("%m\n");
>
Applied
Thanks,
Yuan
More information about the sheepdog
mailing list