[Pacemaker] [PATCH]An option of "quorum-policy" does not become effective.

Andrew Beekhof andrew at beekhof.net
Fri Mar 5 10:06:02 EST 2010


I've applied a modified patch:
   http://hg.clusterlabs.org/pacemaker/stable-1.0/rev/b8db497b90a5

(sorry, forgot to include a credit in the commit log :(

Excellent detective work!

On Fri, Mar 5, 2010 at 6:55 AM,  <renayama19661014 at ybb.ne.jp> wrote:
> Hi All,
>
> Appointment of "quorum-policy" does not become it effectively when we use Pacemaker development
> version.(Pacemaker-1-0-93b87931206e.tar.gz)
>
> The reason is because the problem adds "votes" of the node that it lost, and it handles it.
>
> I offer a patch.
> Because I call member_loop_fn processing twice, my patch may not be good.
>
> ------------------------------------
> diff -r 8271cd63cc48 lib/ais/plugin.c
> --- a/lib/ais/plugin.c  Fri Mar 05 12:48:45 2010 +0900
> +++ b/lib/ais/plugin.c  Fri Mar 05 14:53:57 2010 +0900
> @@ -1116,8 +1116,12 @@
>     struct member_loop_data *data = user_data;
>
>     ais_debug_2("Dumping node %u", node->id);
> -    data->string = append_member(data->string, node);
> -    plugin_has_votes += node->votes;
> +    if (data != NULL) {
> +        data->string = append_member(data->string, node);
> +    }
> +    if (ais_str_eq(CRM_NODE_MEMBER, node->state)) {
> +        plugin_has_votes += node->votes;
> +    }
>  }
>
>  char *pcmk_generate_membership_data(void)
> @@ -1127,6 +1131,13 @@
>     size = 256;
>     ais_malloc0(data.string, size);
>
> +
> +    plugin_has_votes = 0;
> +    g_hash_table_foreach(membership_list, member_loop_fn, NULL);
> +    if(plugin_has_votes > plugin_expected_votes) {
> +       update_expected_votes(plugin_has_votes);
> +    }
> +
>     snprintf(data.string, size,
>             "<nodes id=\""U64T"\" quorate=\"%s\" expected=\"%u\" actual=\"%u\">",
>             membership_seq, plugin_has_quorum()?"true":"false",
> @@ -1134,9 +1145,6 @@
>
>     plugin_has_votes = 0;
>     g_hash_table_foreach(membership_list, member_loop_fn, &data);
> -    if(plugin_has_votes > plugin_expected_votes) {
> -       update_expected_votes(plugin_has_votes);
> -    }
>
>     size = strlen(data.string);
>     data.string = realloc(data.string, size + 9) ;/* 9 = </nodes> + nul */
> ------------------------------------
>
> Best Regards,
> Hideo Yamauchi.
>
>
>
>
> _______________________________________________
> Pacemaker mailing list
> Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>




More information about the Pacemaker mailing list