[Sheepdog] [PATCH] sheep: remove useless log in membership change path
Liu Yuan
namei.unix at gmail.com
Fri Apr 20 08:53:38 CEST 2012
On 04/18/2012 05:19 PM, zituan at taobao.com wrote:
> From: Yibin Shen <zituan at taobao.com>
>
> when large set of nodes join sheep cluster, for example:
> a cluster with 1000 new nodes joining, nearly 100MB log will
> be generated in each node. these logs are almost useless.
>
> Signed-off-by: Yibin Shen <zituan at taobao.com>
> ---
> sheep/group.c | 12 +-----------
> 1 files changed, 1 insertions(+), 11 deletions(-)
>
> diff --git a/sheep/group.c b/sheep/group.c
> index 79600a5..54fdd3f 100644
> --- a/sheep/group.c
> +++ b/sheep/group.c
> @@ -605,8 +605,6 @@ join_finished:
> }
> }
>
> - print_node_list(sys->nodes, sys->nr_nodes);
> -
> sys_stat_set(msg->cluster_status);
> return;
> }
> @@ -829,8 +827,6 @@ static void __sd_join_done(struct event_struct *cevent)
> struct join_message *jm = w->jm;
> struct node *node, *t;
>
> - print_node_list(sys->nodes, sys->nr_nodes);
> -
> update_cluster_info(jm, &w->joined, w->member_list, w->member_list_entries);
>
> if (sys_can_recover() && jm->inc_epoch) {
> @@ -867,8 +863,6 @@ static void __sd_leave_done(struct event_struct *cevent)
> update_epoch_log(sys->epoch);
> }
>
> - print_node_list(sys->nodes, sys->nr_nodes);
> -
This patch remove all the print_node_list() call sites, so we should
remove print_node_list() too
I think we need to add a dprintf() to mark join_done, leave_done event,
otherwise we lost this information which is useful to debug.
Thanks,
Yuan
> if (sys_can_recover())
> start_recovery(sys->epoch);
>
> @@ -1126,8 +1120,6 @@ static void sd_join_handler(struct sd_node *joined,
> switch (result) {
> case CJ_RES_SUCCESS:
> dprintf("join %s\n", node_to_str(joined));
> - for (i = 0; i < nr_members; i++)
> - dprintf("[%x] %s\n", i, node_to_str(members + i));
>
> if (sys_stat_shutdown())
> break;
> @@ -1246,11 +1238,9 @@ static void sd_leave_handler(struct sd_node *left,
> {
> struct event_struct *cevent;
> struct work_leave *w = NULL;
> - int i, size;
> + int size;
>
> dprintf("leave %s\n", node_to_str(left));
> - for (i = 0; i < nr_members; i++)
> - dprintf("[%x] %s\n", i, node_to_str(members + i));
>
> if (sys_stat_shutdown())
> return;
More information about the sheepdog
mailing list