[Sheepdog] [PATCH] sheep: modify cached_epoch

Liu Yuan namei.unix at gmail.com
Fri Mar 16 11:35:44 CET 2012


On 03/16/2012 04:43 PM, yaohaiting.wujue at gmail.com wrote:

> From: HaiTing Yao <wujue.yht at taobao.com>
> 
> cached_epoch is a __thread variable. If it greater than 1, format the
> cluster again will lead to permanent I/O error.
> 
> Signed-off-by: HaiTing Yao <wujue.yht at taobao.com>
> ---
>  sheep/sdnet.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/sheep/sdnet.c b/sheep/sdnet.c
> index 5db9f29..d693858 100644
> --- a/sheep/sdnet.c
> +++ b/sheep/sdnet.c
> @@ -832,7 +832,11 @@ int get_sheep_fd(uint8_t *addr, uint16_t port, int node_idx, uint32_t epoch)
>  	if (before(epoch, cached_epoch)) {
>  		eprintf("requested epoch is smaller than the previous one: %d < %d\n",
>  			epoch, cached_epoch);
> -		return -1;
> +		/* cluster format again */
> +		if (sys->epoch == 1)
> +			cached_epoch = 0;
> +		else
> +			return -1;
>  	}
>  	if (after(epoch, cached_epoch)) {
>  		for (i = 0; i < SD_MAX_NODES; i++) {


Any script that can reproduce this issue?

Thanks,
Yuan



More information about the sheepdog mailing list