[sheepdog] [PATCH] sheep: let all sheeps with smaller epoch added into delayed_nodes list

MORITA Kazutaka morita.kazutaka at gmail.com
Sun Jul 29 19:43:11 CEST 2012


At Sun, 29 Jul 2012 03:42:45 +0800,
Yunkai Zhang wrote:
> 
> From: Yunkai Zhang <qiushu.zyk at taobao.com>
> 
> Since sheeps in delayed_nodes list won't cause recovery when the cluster in
> WAIT_FOR_JOIN state, it's safe to put sheeps with smaller epoch into
> delayed_nodes list, regardless of whether it once belonged to the cluster.
> 
> Benifit from this change, we needn't to restart sheep in the following scenario:
> 
> 1) Start [0,1,2,3] sheeps:
>    epoch of [0,1,2,3] sheeps = 1
> 
> 2) Kill [0] sheep, and then Shutdown [1,2,3] sheeps
>    epoch of [0] sheep      = 1
>    epoch of [1,2,3] sheeps = 2
> 
> 3) Start [1,2] sheeps:
>    epoch of [0] sheep      = 1
>    epoch of [1,2,3] sheeps = 2
>    cluster status = WAIT_FOR_JOIN (waits [3] sheep)
> 
> 4) Start [0] sheep:
>    [0] sheep will be added into delayed_nodes list, needn't to restart
>    epoch of [0] sheep      = 1
>    epoch of [1,2,3] sheeps = 2
>    cluster status = WAIT_FOR_JOIN (waits [3] sheep)
> 
> 5) Start [3] sheep:
>    epoch of [0,1,2,3] sheeps = 3
>    cluster status = OK
>    Now cluster start working...
> 
> Signed-off-by: Yunkai Zhang <qiushu.zyk at taobao.com>
> ---
>  sheep/group.c | 5 -----
>  1 file changed, 5 deletions(-)

Applied, thanks!

Kazutaka



More information about the sheepdog mailing list