[Unison-hackers] Experimental "faster check" mode
Benjamin C. Pierce
bcpierce at cis.upenn.edu
Sat Apr 16 16:41:00 EDT 2011
[Continuing a conversation from almost a year ago...!]
Jerome wrote...
> But "ignorearchives" is set to true when the "ignorearchive"
> preference is set, not when "fastercheckUNSAFE" preference is set...
Sorry, that was a thinko.
>> Would it be better to change Fpcache.save to drop
>> individual fingeprints when they are pseudos?
>
> The check "Prefs.read fastercheckUNSAFE && newfile" should be at the
> beginning of Fpcache.fingerprint rather than in Os.fingerprint.
OK.
>>> - You should check that the Xferhint code still works properly.
>>> I suspect we don't want to store pseudo-fingerprints there either...
>>
>> Pseudo-fingerprints include the fingerprinted path, so we should
>> never have a hit in the Xferhint table on a pseudo-fp.
>
> We should include a fingerprint of the path, not the whole path.
> Otherwise, we will end up with very large archive files.
Good point.
> At the moment, paranoidCheck returns a status: either Success or
> Failure (with some explanation of the failure). In Copy.file,
> checkContentsChange is then called with a different boolean argument
> depending on the status. The function paranoidCheck could return a
> fingerprint instead of the explanation when it cannot decide whether
> the file was correctly transferred. Somethink like:
> let paranoidCheck fspathTo pathTo realPathTo desc fp ress =
> let info = Fileinfo.get false fspathTo pathTo in
> let fp' = Os.fingerprint fspathTo pathTo info in
> if fp' <> fp then begin
> Lwt.return (info, Undecided fp')
> end else
> Lwt.return (info, Success)
> This fingerprint would be passed to checkContentsChangeLocal which
> compute the fingerprint of the source file and can thus make sure the
> two fingerprint matches.
>
> Function checkContentsChangeLocal will have three fingerprints:
> the one from update detection which may be a pseudo-fingerprint
> (FPU), and the fingerprints of the source (FPS) and destination (FPD)
> files. If FPU is not a pseudo-fingerprint, the behavior of the
> function should remain unchanged. If it is a pseudo-fingerprint and
> FPS <> FPD, we should report that the file is not correctly
> transferred.
OK, after a few attempts, I've gotten this bit implemented. Please have a look at the code in copy.ml and see if it makes sense...
- Benjamin
More information about the Unison-hackers
mailing list