[Openais] [PATCH 2/3] NOTIFYD: prevent duplicate quorate events.

Steven Dake sdake at redhat.com
Mon Mar 28 19:40:50 PDT 2011


On 03/28/2011 02:26 AM, Angus Salkeld wrote:
> Signed-off-by: Angus Salkeld <asalkeld at redhat.com>
> ---
>  tools/corosync-notifyd.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/corosync-notifyd.c b/tools/corosync-notifyd.c
> index 4a58189..7f231fa 100644
> --- a/tools/corosync-notifyd.c
> +++ b/tools/corosync-notifyd.c
> @@ -70,6 +70,8 @@ enum {
>  };
>  static int conf[CS_NTF_MAX];
>  
> +static int32_t _cs_is_quorate = 0;
> +
>  typedef void (*node_membership_fn_t)(char *nodename, uint32_t nodeid, char *state, char* ip);
>  typedef void (*node_quorum_fn_t)(char *nodename, uint32_t nodeid, const char *state);
>  typedef void (*application_connection_fn_t)(char *nodename, uint32_t nodeid, char *app_name, const char *state);
> @@ -365,6 +367,11 @@ static void _cs_quorum_notification(quorum_handle_t handle,
>  	uint32_t quorate, uint64_t ring_seq,
>  	uint32_t view_list_entries, uint32_t *view_list)
>  {
> +	if (_cs_is_quorate == quorate) {
> +		return;
> +	}
> +	_cs_is_quorate = quorate;
> +
>  	if (quorate) {
>  		_cs_node_quorum_event("quorate");
>  	} else {
Reviewed-by: Steven Dake <sdake at redhat.com>


More information about the Openais mailing list