Skip to content

bisync: handle volatile changes consistently #5676

Closed

Description

@ivandeex

Synopsis

This problem can be also title recover after transient failures.

@cjnaz once wrote in #5164 (comment)

One perpetual problem I ran into was with a dynamically changing file system. rclonesync is not robust for the case of a file no longer there after the current LSL snapshot was taken. Also, if a file is being written to / blocked when rclonesync wants to copy it. In such cases rclonesync throws up its hands and forces user interaction via a --resync.

Prior discussions

Related to cjnaz/rclonesync-V2#56
Related to #1316

#5164 (comment) (JWink3101)

I agree with these issues of sorts. This isn't new in rclone either. If you change the filesystem while it is running, things can break. For my tool, I enumated what would happen if it is interrupted. Something similar happens if a file changes.

But again, this is the beauty of the not-using-history-to-make-a-changelog approach (#2). You only need history to figure out what to do!. So if a file was added between the lsl, it will still copy.

#5164 (comment) (ivandeex)

Pretty close to #840 (recheck source during operation, open)
Related to #3770 (.partial file support in LocalFS / FTP / SFTP, which can be filtered out by bisync)

Covered by postponed item "Use temporary files with FTP, SFTP"
I guess it will change nothing in bisync but improve FTP/SFTP and only add related tests to bisync.

#5164 (comment) (ivandeex)

@cjnaz

rclonesync is not robust for the case of a file no longer there after the current LSL snapshot was taken.

Such files should be just skipped (by default or under a command-line flag) similar to #5297 (review)

Also, if a file is being written to / blocked when rclonesync wants to copy it. In such cases rclonesync throws up its hands and forces user interaction via a --first-sync.

Pretty close to #840 (recheck source during operation, open)
Related to #3770 (.partial file support in LocalFS / FTP / SFTP, which can be filtered out by bisync)

I think rclonesync approach is right. If bisync detects a mutating file, it should abort operation or just skip the file (depending on a flag e.g. --force), then request a resync and recommend adding this file to a filter.

#5164 (comment) (cjnaz)

One critical design feature / flaw / weakness of rclonesync is that at the
end of the operation the two paths, and thus the two LSL files must match.
If not, then the sync has failed and a --first-sync is forced. So if an
individual file can't be copied then there is no recovery other than a
--first-sync. In the future this will be something to be fixed - so that
transient out-of-sync can be recovered from. Perhaps track mismatches and
retry in the next run?

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Activity

  1. added this to the Help Wanted milestone on Oct 8, 2021
  2. self-assigned this
    on Oct 8, 2021
  3. nielash commented on Aug 23, 2023

    @nielash
    Contributor

    When we tackle this, we should make sure we address all of the following scenarios -- which are related, but distinct:

    • File is created/deleted/renamed between listing snapshots of the same side (current result: error)
    • Existing file is modified between listing snapshots of the same side (during a bisync run which made other changes to the same side) but no files are created/deleted/renamed (current result: silent untrapped changes)
    • Files change between the time it checks a directory on one side and the time it checks the corresponding directory on the opposite side (current result: error (ex. trying to transfer a since-deleted file) or unintended transfers) (more info)
    • File changes while it's being read/written (basically the case for --ignore-checksum) (current result: error)

    My proposed solution is the approach I described here (and here).

  4. self-assigned this
    on Sep 5, 2023
  5. modified the milestones: Help Wanted, Soon on Sep 5, 2023
  6. 5 remaining items

  7. added a commit that references this issue on Jan 20, 2024
    978cbf9
  8. moved this to Done in bisyncon Aug 20, 2024
  9. added a commit that references this issue on Jul 20, 2026
    60e62ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

  • Status
    Done

Relationships

None yet

Development

No branches or pull requests

Issue actions