Re: [PATCH 1/2] flatiron cpg: Never choose downlist with localnode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Have you tried Dave's cpg test tool?  Would be interesting to see if
this introduces any other regressions.

Reviewed-by: Steven Dake <sdake@xxxxxxxxxx>

On 06/13/2012 07:07 AM, Jan Friesse wrote:
> Test scenario is follows:
> - node 1, node 2
> - node 1 is paused
> - node 2 sees node 1 dead
> - node 1 unpaused
> - node 1 and 2 both choose same dowlist message which includes node 2 ->
> node 2 is efectivelly disconnected
> 
> Patch includes additional test if left_node is localnode. If so, such
> downlist is ignored.
> 
> Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
> (backported to flatiron)
> ---
>  services/cpg.c |   21 +++++++++++++++++++++
>  1 files changed, 21 insertions(+), 0 deletions(-)
> 
> diff --git a/services/cpg.c b/services/cpg.c
> index d7a26f2..dbd61c5 100644
> --- a/services/cpg.c
> +++ b/services/cpg.c
> @@ -729,6 +729,8 @@ static struct downlist_msg* downlist_master_choose (void)
>  	struct list_head *iter;
>  	uint32_t cmp_members;
>  	uint32_t best_members;
> +	uint32_t i;
> +	int ignore_msg;
>  
>  	for (iter = downlist_messages_head.next;
>  		iter != &downlist_messages_head;
> @@ -736,10 +738,26 @@ static struct downlist_msg* downlist_master_choose (void)
>  
>  		cmp = list_entry(iter, struct downlist_msg, list);
>  		downlist_log(LOGSYS_LEVEL_DEBUG, "comparing", cmp);
> +
> +		ignore_msg = 0;
> +		for (i = 0; i < cmp->left_nodes; i++) {
> +			if (cmp->nodeids[i] == api->totem_nodeid_get()) {
> +				log_printf (LOG_DEBUG, "Ignoring this entry because I'm in the left list\n");
> +
> +				ignore_msg = 1;
> +				break;
> +			}
> +		}
> +
> +		if (ignore_msg) {
> +			continue ;
> +		}
> +
>  		if (best == NULL) {
>  			best = cmp;
>  			continue;
>  		}
> +
>  		best_members = best->old_members - best->left_nodes;
>  		cmp_members = cmp->old_members - cmp->left_nodes;
>  
> @@ -754,6 +772,9 @@ static struct downlist_msg* downlist_master_choose (void)
>  		}
>  
>  	}
> +
> +	assert (best != NULL);
> +
>  	return best;
>  }
>  

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux