Skip to content

Speed up delete propagation when it's not a rename #4953

Closed

Description

@codl

As I understand it, the file watcher batches edits by 10s periods and deletes by 60s periods

However it seems that if a file is deleted and then recreated shortly after, then that whole edit will be delayed by 60 seconds. Is this intentional? This is essentially the same thing as clobbering a file so I would expect the delay to be the same as clobbering.

Version Information

Syncthing Version: v0.14.47
OS Version: Arch Linux

Activity

  1. imsodin commented on May 14, 2018

    @imsodin
    Member

    Yes it is intentional.

    I don't know what clobbering means, maybe it's relevant to know that the FS watcher/aggregation/delay part does not know about file contents.

    I am currently struggling with making up a concrete example where the policy actually helps, but the general idea is: Existing files can be delayed up to 6x the wait time if modified multiple times. New files can be reconstructed from existing files on the remote, so delay anything that was deleted (i.e. also delete&create) by 6x the wait time too.
    I mean I can come up with a scenario, but it is not very convincing: Rename file A to B, create a different file A and keep modifying the new file B, without changing its content much/at all. Then if A wasn't delayed, B wouldn't be reconstructed from A on the remote (as A was already replaced).

    However I think it's fine to err on the save side, so unless someone has some convincing arguments against it, I'd keep the current behaviour.

  2. Ferroin commented on May 14, 2018

    @Ferroin

    IMO, the current behavior (10 second batching for most stuff, 6x that for deletion or multiple modifications) is sensible for most use cases, but it would be kind of nice to be able to tweak both values on a per-folder basis. As a couple of examples:

    • I have a folder where I have a bunch of playlists, and when I edit those, I do so pretty slowly, and would much rather batch all the changes I make into one update, so for that folder, it would be nice to be able to bump up both values significantly.

    • On the other side of things, I do have a small handful of things where changes are very infrequent and consist of single writes, but I want them propagated as fast as possible, even if it means that data may not be reused as much as it otherwise would. In this case, it would be wonderful to just drop the batching down to 1 second, and remove the multiplier.

  3. imsodin commented on May 14, 2018

    @imsodin
    Member

    Lets continue this discussion on the forum: https://forum.syncthing.net/t/discussing-fs-watcher-delays-4953/11593

    I am not dismissing the issue, it's a legitimate question and there might be need for change, but there is still clearly need to explain and discuss before a clear path forward (if any) turns up. For that the forum is the better venue (reducing mail noise). Will be reopened if necessary.

  4. added a commit that references this issue on May 15, 2018
    0b9fe01
  5. imsodin commented on May 15, 2018

    @imsodin
    Member

    I am reopening this as I want to close it by my proposal on the accompanying forum discussion:

    I am now implementing a mechanism, that will speed things up in most cases:
    If there are no “creations” being delayed, “removals” don’t get an additional delay either (i.e. only the normal 10s instead of 1min).

  6. added a commit that references this issue on Jun 2, 2018
    ea27120
  7. added this to the v0.14.49 milestone on Jun 5, 2018
  8. changed the title [-]Watcher delays edit with a delete by 60 seconds[/-] [+]Speed up delete propagation when it's not a rename[/+] on Jun 11, 2018
  9. added
    enhancement
    on Jun 11, 2018
  10. dburkhardt commented on Jun 12, 2018

    @dburkhardt

    Since the discussion on the forum is as old as this, and someone is looking at this, I'll comment here. I really dislike the delay in deleting files. I use syncthing to help me do data analysis on a remote server. A common workflow is as follows:

    1. Run a script on remote that creates a figure
    2. Wait for syncthing to sync that figure to local
    3. Inspect figure on local
    4. Realize I've made a mistake, edit the script, repeat from 1.

    Now when I rerun, usually the new file has the same name as the old. So because of this delay in fs_watcher, the latency is seeing changes is 60 seconds. This delay is very annoying and I can't figure out a way to change it.

    Inotify was almost instantaneous for this process, and I would really like to see this with fs_watcher.

  11. AudriusButkevicius commented on Jun 12, 2018

    @AudriusButkevicius
    Member

    Well that won't happen, as we'll have a different set of users who will be moaning that we don't handle renames.

  12. calmh commented on Jun 12, 2018

    @calmh
    Member

    Why are you complaining on a fixed issue? If the fix, which is in 0.14.49 (release candidate out today), does not fix your use case please open a corresponding new issue.

  13. added
    frozen-due-to-age
    on May 27, 2019
  14. locked and limited conversation to collaborators on May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfrozen-due-to-age

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions