Skip to content

Add fastcheckdir preference (workaround for Windows bug) #1130

@gdt

Description

@gdt

Motivation and Background

Multiple users report that at least on ExFAT, Windows systems do not update the directory mod time when adding a file, more or less. See #1122 for lengthy discussion, and pointers to standards. So far, there are no reports of other operating systems having this bug.

With fastcheck true, a directory with the same mod time is presumed unchanged -- not surprising, given the specifications. Thus, people running unison with an ExFAT filesystem (and maybe FAT32) that was written by Windows would want to disable at least this part of fastcheck. Test reports indicate that fastcheck=false results in correct synchronization. However, disabling fastcheck is a severe performance penalty, and even just disabling it on directories appears significant.

Currently, directory fastchecking is disabled on Windows. This seems incorrect, without evidence that Window's NTFS and other filesystems (including CIFS hosted on Unix) have the same bug.

This is marked windows because while people will want to use the feature on non-Windows, it is fundamentally about accomodating Windows.

Scope

The proposed behavior has been crafted to be useful to those synchronizing files on exFAT that have been written by Windows, regardless of the operating system being used for unison, while not imposing performance penalties on anyone not suffering from the not-updating-timestamp bug. The scope includes removing a previous workaround because the new workaround is sufficient and more precise.

Will you write code?

I am not going to write this; it solves a problem I don't have. I've created the feature request to be able to close a lengthy issue. Thus, this awaits a PR.

Operation of the new feature

Add (and document) a new preference fastcheckdir, defaulting to true. If fastcheck is false, then all fastcheck optimizations will continue to be omitted, just as now. Assuming fastcheck true, fastcheckdir will control the optimization for directories. Thus, setting fastcheckdir=false will skip update.ml:dirContentsClearlyUnchanged.

Remove the automatic disabling of fastcheckdir on !unix. Alternatively, document behavior of Windows on other kinds of filesystems also (including remote CIFS hosted on Unix and NFS) if there is a case that fastcheckdir never works. In that case, add finer-grained checks for enabling the workaround.

Complexity vs Benefit

While new prefererences are basically bad, this isn't confusing and will benefit a lot of users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort-mediumissue is likely resolvable with <= 20h of effortenhancementissue is a request for a feature, and not a defectimpact-lowlow importancewindowsspecific to Microsoft Windowswontfixmaintainers choose not to work on this, but PR would still be considered

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions