[Unison-hackers] Problem with fractional mtime? ("destination updated during synchronization")

bcpierce@seas.upenn.edu bcpierce at seas.upenn.edu
Thu Jan 1 10:37:41 EST 2009


Thanks for this, Jerome!  I am considering another change that will  
also require an archive format bump, so I will incorporate this at the  
same time.

    - Benjamin


Quoting Jerome Vouillon <Jerome.Vouillon at pps.jussieu.fr>:

> On Sun, Nov 23, 2008 at 08:44:54AM -0500, Benjamin Pierce wrote:
>> There is some rather tricky code in props.ml (in the sub-module Time)
>> that compares file modtimes while trying to take into account some
>> possible reasons why unchanged files may appear to have different
>> modtimes (e.g., daylight savings time, or one filesystem being FAT,
>> which can only store modtimes with a resolution of two seconds).  If
>> the problem you're seeing is really with fractional modtimes, it may
>> be possible to fix it by changing something here...
>
> The fix should be the following:
> - Use function similar_correct, which ignore one-second differences,
>   instead of function similar in module Time in file props.ml
> - Change the definition of function hash from
>       let hash t h =
>         Uutil.hash2
>           (match t with
>              Synced f    -> Hashtbl.hash (moduloOneHour (approximate f))
>            | NotSynced _ -> 0)
>           h
>   to
>       let hash t h = h
>   (Two similar times should have the same hash; if we ignore
>    one-second differences, this mean that all times should have the
>    same hash.)
> - Increment the variable archiveFormat in file update.ml
>   (Indeed, the archive invariant is changed.)
>
> This is a change that I have wanted to perform for some time, but
> never did because of the archive format change.
>
> -- Jerome
> _______________________________________________
> Unison-hackers mailing list
> Unison-hackers at lists.seas.upenn.edu
> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers
>




More information about the Unison-hackers mailing list