[Unison-hackers] Experimental "faster check" mode

Benjamin C. Pierce bcpierce at cis.upenn.edu
Sat Jul 24 09:44:25 EDT 2010

Thanks for the comments, Jérome!

> - *Don't* store pseudo-fingerprints in the fingerprint cache.  The
>  cache contents should reflect what is known about file contents, and
>  thus not depend on Unison settings. Pseudo-fingerprints should be
>  handled at a higher level.  In particular, the fingerprint cache
>  provides a way to rebuild an archive rapidly, without having to
>  rescan all files.  Your code is breaking that.

The test

  if fastCheck && not ignorearchives then begin

at the beginning of Fpcache.init was intended to prevent pseudo-fingerprints from getting into the cache (by turning off caching).  Would it be better to change Fpcache.save to drop individual fingeprints when they are pseudos?

> - 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.  Still, it is a waste of space.  I'll change Xferhint.insertEntry like this:

let insertEntry fspath path fp =
  if Prefs.read xferbycopying && not (Os.isPseudoFingerprint fp) then begin

> - If I read the code correctly, when "fastercheckUNSAFE" is set to
>  true, any new file will fail to transfer.  This is the safe thing to
>  do (though the failure happen at a very late stage, once the file
>  contents has been transferred) but is very restrictive.  I explained
>  in my previous mail how we can perform a transfer safely in this
>  case too, but a protocol change is needed.  (That would be useful
>  when one replica is initially empty: Unison would be able to start
>  transferring files right away.)

Sorry -- I had gotten partway though this case and forgot to finish it.  I didn't completely understand your recommendation, since paranoidCheck is called in two places (and neither of them is in checkContentsChangeLocal), but I'll have another look now...

     - Benjamin

More information about the Unison-hackers mailing list