[sheepdog] [PATCH] sheep: reduce auto recovery log

Liu Yuan namei.unix at gmail.com
Fri Jun 6 07:54:36 CEST 2014


On Fri, Jun 06, 2014 at 11:30:08AM +0900, Saeki Masaki wrote:
> Currently, auto recovery process produces one log message per one object.
> The log messages consume too large disk space when a cluster has many
> objects. This patch reduces the disk consumption by printing progress in a
> style of percentage. The existing message is logged in debug level.
> 
> Signed-off-by: Saeki Masaki <saeki.masaki at po.ntts.co.jp>
> ---
>  sheep/recovery.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/sheep/recovery.c b/sheep/recovery.c
> index a5aa750..8d87f4c 100644
> --- a/sheep/recovery.c
> +++ b/sheep/recovery.c
> @@ -901,8 +901,11 @@ static void recover_object_main(struct work *work)
>  
>  	wakeup_requests_on_oid(row->oid);
>  
> -	sd_info("object %"PRIx64" is recovered (%"PRIu64"/%"PRIu64")", row->oid,
> -		rinfo->done, rinfo->count);
> +	if (!(rinfo->done % (rinfo->count/100)))
> +		sd_info("object recovery progress %3.0lf%% ",
> +			(double)rinfo->done / rinfo->count * 100);
> +	sd_debug("object %"PRIx64" is recovered (%"PRIu64"/%"PRIu64")",
> +		row->oid, rinfo->done, rinfo->count);
>  
>  	if (rinfo->done >= rinfo->count)
>  		goto finish_recovery;
> -- 
> 1.7.1
> 
> 
> 
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog

Applied thanks

Yuan



More information about the sheepdog mailing list