[sheepdog] [PATCH 2/2] zookeeper: fix master transfer logic
Liu Yuan
namei.unix at gmail.com
Mon May 21 04:33:35 CEST 2012
On 05/18/2012 06:28 PM, Yunkai Zhang wrote:
> When a sheep joins into the cluster, master will call
> sd_check_join_cb() to get the join_result which will be
> update to ev.buf, and all sheep will receive this update.
>
> If join_result equals to CJ_RES_MASTER_TRANSFER, master will
> kill itself by exit(). Zookeeper needs at most SESSION_TIMEOUT
> to detect master's leaving action, it's better to call zk_leave()
> explicitly before master exit. On the other hand, other sheeps
> will continue to process the updated JOIN EVENT.
>
> But now, Sheepdog assumes that only one sheep(the joining sheep)
> is alive in MASTER_TRANSFER scenario, this can simplify processing
> logic(maybe we will overthrow this assumption in the future for other
> corner-case).
>
> Based on this assumption, the joining sheep just need to reset
> its member_list(saved in node_btree in zookeeper driver), make
> it only contains itself.
Applied these two. Thanks.
Yuan
More information about the sheepdog
mailing list