[sheepdog] [PATCH v3] sheep: remove master node

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Jul 23 10:02:52 CEST 2013


At Tue, 23 Jul 2013 12:44:15 +0800,
Liu Yuan wrote:
> 
> > diff --git a/sheep/group.c b/sheep/group.c
> > index 4a2a83b..054292d 100644
> > --- a/sheep/group.c
> > +++ b/sheep/group.c
> > @@ -779,14 +779,22 @@ void sd_notify_handler(const struct sd_node *sender, void *data,
> >   * Accept the joining node and pass the cluster info to it.
> >   *
> >   * Note that 'nodes' doesn't contain 'joining'.
> > + *
> > + * Return true if the joining node is accepted.  At least one nodes in the
> > + * cluster must call this function and succeed in accept of the joining node.
> >   */
> > -void sd_join_handler(const struct sd_node *joining,
> > +bool sd_join_handler(const struct sd_node *joining,
> >  		     const struct sd_node *nodes, size_t nr_nodes,
> >  		     void *opaque)
> >  {
> >  	struct join_message *jm = opaque;
> >  	char str[MAX_NODE_STR_LEN];
> >  
> > +	if (nr_nodes > 0 && node_is_local(joining)) {
> > +		sd_dprintf("wait for another node to accept this node");
> > +		return false;
> > +	}
> > +
> 
> Is there any case nr_nodes = 0? If not, we don't need this check

Note that nr_nodes doesn't include the joining node.  The first
joining sheep must pass the check.

Thanks,

Kazutaka



More information about the sheepdog mailing list