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

Kai Zhang kyle at zelin.io
Sat Jul 20 09:21:55 CEST 2013


On Jul 19, 2013, at 12:01 PM, MORITA Kazutaka <morita.kazutaka at gmail.com> wrote:

> 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_join_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.
> 
> Removing a master from zookeeper is not easy since it doesn't expect
> that multiple nodes send EVENT_ACCEPT.  I'll leave this for another
> day.


Here are 2 questions in my mind:

1. Based on current implementation of cluster driver, we accept all join request
when the cluster is running.
However, consider the fowling scenario:
- cluster runs with A, B, C, D
- A quits for some reasons
- after A quits, lots of data operations happened
- B, C, D all quit for some reasons
- A comes back with old data
- B, C, D come back
In this scenario, old data will overwrite new data, no?

2. All sheep who join an empty cluster at the same time will always successful.
Is this safe?


By the way, in term of zookeeper, I think it can work well when there are multiple EVENT_ACCEPT
events for one join request.
This is because an update event will only trigger zookeeper driver to fetch a event from the queue.
If the event is "accept", then it will handle it by calling sd_accept_handler and move to next node.
The fowling update event will trigger it to find if there is a new event, but not to handle the EVENT_ACCEPT
again.
So the sd_accept_handler() will be called only once for one join request in one sheep.
If so, we can remove "master" from zookeeper driver totally.

Thanks,
Kyle

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20130720/ec3a5681/attachment-0004.html>


More information about the sheepdog mailing list