DO NOT REPLY [Bug 3461] rsync is not atomic when temp-dir is on different device

bugzilla-daemon at dp3.samba.org bugzilla-daemon at dp3.samba.org
Sun Jan 29 01:28:01 GMT 2006


https://bugzilla.samba.org/show_bug.cgi?id=3461





------- Comment #3 from hashproduct at verizon.net  2006-01-28 18:27 MST -------
Hmmm.  It's true that rsync interleaves memory-mapped reads from the basis file
and writes to the temporary file.  A smart disk scheduler should avoid making
the head dart back and forth by saving up all the writes to be done later a
single stream.  However, your data set is probably so large that the disk
scheduler is nervous to keep it all in write-behind cache.  You might be able
to get the same improved performance by messing with disk parameters.  If you
find a way to set the write-behind cache size on disk 1, you could set it to
several gigabytes and then allocate a several-gigabyte swap partition on disk
2, in which case the fancy maneuver involving disk 2 would be done at the
kernel level instead of by rsync.

Some other options to consider:
* Hack your own copy of rsync to use a second temporary file.
* Create a batch file on disk 2 with --only-write-batch.  Then apply it with
--read-batch.  That may or may not help.
* Run two passes of rsync.  Consider this:
    rsync -rt remote::files/ /disk2/tmp/ --compare-dest=/disk1/files/
    rsync -a remote::files/ /disk1/files/ --copy-dest=/disk2/tmp/


-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.


More information about the rsync mailing list