[sheepdog] [PATCH] sheep: remove master node

Liu Yuan namei.unix at gmail.com
Sun Jul 14 11:39:12 CEST 2013


On Sun, Jul 14, 2013 at 12:08:46AM +0900, MORITA Kazutaka wrote:
> From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
> 
> The current procedure to handle sheep join is as follows.
> 
>  1. The joining node sends a join request.
>  2. The master node accepts the request.
>  3. All the nodes update cluster members.
> 
> This procedure has some problems:
> 
>  - The master election is too complex to maintain.
>    It is very difficult to make sure that the implementation is
>    correct.
> 
>  - The master node can fail while it is accepting the joining node.
>    The newly elected master has to take over the process, but it's
>    usually difficult to implement because we have to know what the
>    previous master did and what it did not before its failure.
> 
> This patch changes the sheep join procedure to the following.
> 
>  1. The joining node sends a join request.
>  2. Some of the existing nodes accept the request.
>  3. All the nodes update cluster members.
> 
> It is allowed for the multiple nodes to call sd_accept_handler()
> against the same join request, but at least one node must have to do
> it.  With this change, we can eliminate a master, and node failure
> while accepting node join is also allowed.
> 
> The zookeeper driver still needs master election to handle concurrent
> joins.  I wrote it as a TODO in the source code.
> 

I think you'd exchange the name of sd_join_handler and sd_accept_handler within
this patch.

Thanks
Yuan



More information about the sheepdog mailing list