[Sheepdog] PATCH S003: Handle master crashing before sending JOIN request

Liu Yuan namei.unix at gmail.com
Sat Apr 28 11:34:33 CEST 2012


On 04/28/2012 05:22 PM, Shevek wrote:

>> > -               if (join_finished)
>> > +               if (join_finished || is_master(&cevent->sender))
> I believe this patch does NOT work:
> 
> 1) is_master returns -1 for not-master, 0 means the given node is
> master, so this is apparently a misuse of is_master.
> 
> However, even worse:
> 
> 2) If we never got a join response, then line 388:
>     388 if (!cevent->blocked && cpg_node_equal(&cevent->sender,
> &this_node)) {
> never triggered, therefore we have never set join_finished, and
> nr_cpg_nodes is always 0 (look for every place where it got set), so
> is_master() is always 0.
> 
> So, by inspection, this patch can never work, for both reasons.
> 


Oh, yes. Thanks for pointing it out.

But what if set set

                if (join_finished || (is_master(&cevent->sender >= 0)))
                        done = __corosync_dispatch_one(cevent);
                else
                        done = !cevent->blocked;

Then, the master will be called for sure, and would give other nodes a
join response.

Thanks,
Yuan



More information about the sheepdog mailing list