[Sheepdog] [PATCH] sheep: cpg_local_get() should be called before cpg_join()
MORITA Kazutaka
morita.kazutaka at lab.ntt.co.jp
Thu Sep 29 20:01:07 CEST 2011
At Thu, 29 Sep 2011 13:46:18 +0800,
zituan at taobao.com wrote:
>
> From: Yibin Shen <zituan at taobao.com>
>
>
> Signed-off-by: Yibin Shen <zituan at taobao.com>
> ---
> sheep/group.c | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
Applied, thanks!
Kazutaka
>
> diff --git a/sheep/group.c b/sheep/group.c
> index 38fc43a..80a8f54 100644
> --- a/sheep/group.c
> +++ b/sheep/group.c
> @@ -1990,6 +1990,12 @@ int create_cluster(int port, int64_t zone)
> return -1;
> }
>
> + ret = cpg_local_get(cpg_handle, &nodeid);
> + if (ret != CPG_OK) {
> + eprintf("Failed to get the local node's identifier, %d\n", ret);
> + return 1;
> + }
> +
> join_retry:
> ret = cpg_join(cpg_handle, &group);
> switch (ret) {
> @@ -2007,12 +2013,6 @@ join_retry:
> return -1;
> }
>
> - ret = cpg_local_get(cpg_handle, &nodeid);
> - if (ret != CPG_OK) {
> - eprintf("Failed to get the local node's identifier, %d\n", ret);
> - return 1;
> - }
> -
> sys->handle = cpg_handle;
> sys->this_nodeid = nodeid;
> sys->this_pid = getpid();
> --
> 1.7.6.3
>
> --
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog
More information about the sheepdog
mailing list