[sheepdog] [PATCH] zk: delete zk node before join cluster

Kai Zhang kyle at zelin.io
Fri May 31 03:44:10 CEST 2013


On May 30, 2013, at 11:09 PM, Liu Yuan <namei.unix at gmail.com> wrote:

> On 05/30/2013 03:20 PM, Liu Yuan wrote:
>> On 05/30/2013 02:37 PM, Kai Zhang wrote:
>>> Delete zk node before join cluster and return -1 when fail.
>> 
>> Applied, thanks.
>> 
> 
> Oops, this patch breaks
> 
>        /* For concurrent nodes setup, we allow only one to continue */
>        while (zk_member_empty() && zk_master_create() != ZOK)
>                ;/* wait */
> 
> I guess this was why in the old code I chose to panic(). Now when I
> start 3 node concurrently, I'll end up with 3 nodes are all master.
> Unless we find a solution, this patch will be reverted.

However, current implementation of master election also has problem.

I will rewrite this by using sequential node which is a standard way of implementing master election.

Thanks,
Kyle


More information about the sheepdog mailing list