-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--sparse + --inplace = broken files #114
Comments
Experiencing the same issue when sending from an Arch system (rsync 3.2.3) to a Debian-based system (rsync 3.1.3). |
Did some more poking and found that the issue seems to exist even in commit f3873b3 which introduced the I've attached a script which will consistently reproduce the issue: testcase.sh.txt |
Rsync 3.1.3 is too old for that option combo. You need at least 3.2.0: https://download.samba.org/pub/rsync/NEWS#3.2.0 I couldn't get your test case to fail with a newer rsync (just an older one). |
The test script fails with exit code 1 every time on Arch Linux and its rsync 3.2.3-3. |
@WayneD what distro are you testing on? I'm also on Arch and get 100% testcase failure on any version I try (master branch, 3.2.3-3, or the initial commit). I'm going to set up a couple of fresh VMs to see if I can find any distro dependence... Thanks for the heads-up on 3.1.3 being incompatible, BTW. |
The testcase script has failed in each of the VMs that I've set up:
Each distro was fully updated prior to running the testcase against the master branch. I've attached a script which I've used to clone, build, and test on each system: rsync-test-setup.sh.txt |
I've tracked down the issue to a spurious truncate due to the whole_file var being -1. You should be able to avoid the issue in various recent rsync versions by forcing |
Fixed in git. Thanks for the test-case help! |
@WayneD to clarify, does this disable delta xfer algorithm on all files in the transfer? This would require users to keep track of sparse files and do separate rsync runs, to get efficient transfers of their non-sparse files |
You've confused --whole-file with --no-whole-file. Though many people would get better transfer speeds these days with --whole-file (no delta xfer), the above explicit setting of --no-whole-file ensures that the already-in-effect default transfer option gets properly honored in all the checks on older rsyncs. This is due to the whole_file var's 3 states: default, requested-on & requested-off. The value got left as "default" which most of the code treated as "off", but the sparse code treated it as "on". While the bug can also be avoided using --whole-file (-W), my recommendation of explicitly specifying --no-W (and making sure that the remote side gets that option too) makes it work without any change in behavior from the default. |
rsync -avi --sparse --inplace host:path dest
The result is never-completed,
failed verification
errors, like this:The failed files have a lot of zero bytes at the beginning or end. I didn't check all of them and there may be other cases.
The filesystem on both sides doesn't matter (tried btrfs and tmpfs). I didn't reproduce it with a local transfer.
All involved systems are recent Arch boxes and rsync version is 3.2.3-1.
The text was updated successfully, but these errors were encountered: