[Csync2] speed of "-cr /"

Lars Ellenberg lars.ellenberg at linbit.com
Fri Jun 11 13:26:29 CEST 2010


On Fri, Jun 11, 2010 at 01:05:02PM +0200, Lars Ellenberg wrote:
> > I'll consider it now that I understand the limitations of 'groups' in csync2.
> 
> You may also try this patch.  It may, in certain situations (probably
> involving prefix substitutions) have a few side-effects I'm not aware
> right now, but it should work at least for what you seem to be doing.
> Don't forget the explicit "-G ", or it won't have much effect.
> 
> 
> diff --git a/check.c b/check.c
> index 53736ba..558c514 100644
> --- a/check.c
> +++ b/check.c
> @@ -160,7 +222,12 @@ void csync_check_del(const char *file, int recursive, int init_run)
>  			"filename = '%s' %s ORDER BY filename", url_encode(file), where_rec)
>  	{
>  		const char *filename = url_decode(SQL_V(0));
> -		if ( lstat_strict(prefixsubst(filename), &st) != 0 || csync_check_pure(filename) )
> +		const char *real_filename = prefixsubst(filename);
> +		
> +		if (!csync_match_file(real_filename))

hm. actually this apparently needs to be 
   		if (!csync_match_file(filename))
i.e. still containing the prefix substitution marker, if any...

> +			continue;
> +			
> +		if ( lstat_strict(real_filename, &st) != 0 || csync_check_pure(filename) )
>  			textlist_add(&tl, filename, 0);
>  	} SQL_END;

Note that this may increase the total runtime,
if you actually do mean "scan everything",
I did no benchmarks or anything on that,
just pointing out the relevant code section....

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.


More information about the Csync2 mailing list