[Dirvish] using --inplace ?

Paul Slootman paul at debian.org
Fri Sep 1 10:36:03 UTC 2006


On Fri 01 Sep 2006, Dave Howorth wrote:
> Paul Slootman wrote:
> >I was chekcing what rsync does in a typical dirvish run. Basically lots
> >of stat()s of the file in the destination directory, stat()s of the file
> >in the link-dest directory, then (when the file doesn't yet exist) an
> >open() for writing in the destination directory with a temporary
> >filename, and then a rename() at the end.
> 
> What does it do in the case where the file does exist but has changed?

The way dirvish works, the destination directory is always empty; the
file may exist in the --link-dest directory, but then rsync will also
write first to a temp filename and then rename it without the --inplace
option.

> >I considered that the use of a temp name and then a rename doesn't
> >really make much sense in dirvish usage. Since rsync 2.6.3 (30 Sep 2004)
> >it knows about --inplace.
> 
> But according to the man page, I think we can only use it from 2.6.4 
> onwards:
> "Prior to rsync 2.6.4 --inplace was also incompatible with 
> --compare-dest and --link-dest."

Indeed, it complains about protocol 29 being needed, as I discovered
this morning :-)  A good way of detecting systems with outdated rsync
versions, BTW; those systems that failed to backup last night now have
rsync 2.6.8 installed.

> >This will save 2 system calls per new or
> >changed file. Doesn't sound like much, but it's a lot of metadata
> >updates that will impact journalling filesystems.
> 
> I'm all for saving system calls (and context switches :) so this sounds 
> like a good idea.
> 
> >Can anyone think of a reaon why using it would be a bad idea, besides
> >the fact that an older rsync version may be in place (pun intended),
> >in which case it should be upgraded anyway?
> >
> >I've actually modified dirvish already on one of the systems I have
> >dirvish running on to use --inplace, I'll check tomorrow how it went.
> 
> It always comes down to how to know something didn't break, doesn't it?

Indeed; however, luckily dirvish is fairly anal about checking results,
so I'm fairly confident that nothing will break without being noticed.

I'll continue testing.


Paul Slootman


More information about the Dirvish mailing list