[sheepdog] [PATCH 2/2] sheep: use default copy number when vdi state is not available

Liu Yuan namei.unix at gmail.com
Wed Aug 28 10:37:53 CEST 2013


On Wed, Aug 28, 2013 at 03:30:53PM +0900, MORITA Kazutaka wrote:
> From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
> 
> Currently, screen_object_list() drops an object from the recovery list
> when its copy number is not available.  This can happen, e.g., when we
> lost all the inode replicas temporary.  To fix the problem, this patch
> makes get_vdi_copy_number() return the default copy number when sheep
> doesn't have the vdi state.
> 
> This patch is necessary to pass test/functional/074.
> 
> Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
> ---
>  sheep/gateway.c     |   18 +++++++++---------
>  sheep/plain_store.c |    6 +-----
>  sheep/recovery.c    |    6 +-----
>  sheep/vdi.c         |    4 ++--
>  4 files changed, 13 insertions(+), 21 deletions(-)
> 
> diff --git a/sheep/gateway.c b/sheep/gateway.c
> index af7ba2a..35858e6 100644
> --- a/sheep/gateway.c
> +++ b/sheep/gateway.c
> @@ -41,13 +41,13 @@ int gateway_read_obj(struct request *req)
>  		goto out;
>  	}
>  
> -	nr_copies = get_req_copy_number(req);
> -
> -	if (nr_copies == 0) {
> -		sd_debug("there is no living nodes");
> +	if (req->vinfo->nr_vnodes == 0) {
> +		sd_err("there is no living nodes");
>  		return SD_RES_HALT;
>  	}
>  
> +	nr_copies = get_req_copy_number(req);
> +
>  	oid_to_vnodes(req->vinfo->vnodes, req->vinfo->nr_vnodes, oid,
>  		      nr_copies, obj_vnodes);
>  	for (i = 0; i < nr_copies; i++) {
> @@ -266,6 +266,11 @@ static int gateway_forward_request(struct request *req)
>  
>  	sd_debug("%"PRIx64, oid);
>  
> +	if (req->vinfo->nr_vnodes == 0) {
> +		sd_err("there is no living nodes");
> +		return SD_RES_HALT;
> +	}
> +

Applied, thanks

Yuan



More information about the sheepdog mailing list