[Bug 13071] [PATCH] Allow --partial-dir with --inplace

samba-bugs at samba.org samba-bugs at samba.org
Sun Apr 26 19:46:49 UTC 2020


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

Wayne Davison <wayne at opencoder.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #5 from Wayne Davison <wayne at opencoder.net> ---
I dislike confusing what --inplace means. While an expert will know that it
changes meaning in different circumstances, I think it best that it always
means that the final destination file should be updated in-place, and thus
rsync should tell the user when it can't be used in combination with other
options.

As for the changes in this patch, I see 2 aspects of its interaction with the
partial-dir.  First, what happens when transferring a file that has a partial
file that already exists? And second, is the partial-dir used to store all the
temp files that are created for a transfer rather than the normal tmp file
being created and the partial-dir only getting created if the transfer is
interrupted?

As for the first part, I'm thinking that it would be fine if we change how a
partial-dir file is handled to always update it in-place, especially since
there is a good chance that the transferred file's early data is OK. The hard
part of that is that the sender needs to know which files are in-place
transfers so that it can restrict the checksum matching algorithm, so we must
know that the sender is new enough to respond to a FNAMECMP_PARTIAL_DIR value
as an indicator that the file is going to be handled in-place.  This could be
done via a compat flag character sent via -e or by forcing it to be an option
that an older sender would reject as unknown.

As for the second part, I'm not sure how much of a need there is for changing
the default behavior of the tmp file creation, and would probably not include
that change.  Also, the patch has an error in it where files in a subdir of the
transfer do not get created if the partial-dir is a relative path instead of an
absolute path (this is due to its use of "dummy" in the call that creates the
dir).

One interesting aspect of the patch is that it allows the --append option to be
used on partial files.  This could be useful if you're 100% certain that the
huge partial file is still a valid prefix of the source file.  However,
specifying --append with a --partial-dir would also affect how non-partial-dir
files get transferred, and is thus not a good way to affect just the continuing
of a partial-dir file's contents.  If we want appending of partial file data,
it would be better to add a --partial-append option and have both sides only
apply append behavior to the FNAMECMP_PARTIAL_DIR transfers.

Finally, since this patch sets the inplace flag for all files, it also has the
side effect that even non-partial files get the limited checksum matching
rules, which can make some transfers of shifted data much less efficient.

I'm looking at a simpler change which I will attach as a patch. I would
appreciate some feedback if the simpler behavior is enough for what you wanted
from this change.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.



More information about the rsync mailing list