Skip to content

Create a --retries-failed-only option #2291

Open

Description

@l-e-o-n-c-e

As stated in the documentation, the --retries int option "Retries the entire sync", which requires a lot of useless work on both sides for just few files having failed on a very big tree.

Would it be possible to create a --retries-failed-only int option ?

I imagine it working like this :

  • each time a file transfer fails, add its source and destination paths in a list kept in memory
  • at the end of the sync, retry only the content of this list instead of retrying the entire sync
    Of course this list could be limited to, for example, 100 failing files. If the list reaches this limit, then a full sync is triggered instead.

In a sync I am currently running, I see 10 or 20 errors for more than 100.000 files being processed, which means that the next retry will check all these files again whereas it should, in my opinion, only retry the failed ones.

Activity

  1. ncw commented on May 5, 2018

    @ncw
    Member

    This is a nice idea....

    It would need a bit of care distinguishing between errors which need a new sync (like failure to read a directory) and errors which don't (eg a file copy failing).

    Depending on the mode of the sync (sync, copy or move) you might want to do different things also.

    One thing you could try now is increasing --low-level-retries. Each copy should be tried that many times before a complete retry of the sync.

  2. added this to the Soon milestone on May 5, 2018
  3. dlong500 commented on Aug 10, 2018

    @dlong500

    This would be immensely helpful. I'm half way through syncing 6 million files to B2 and there are about 9000 errors so far. It would be so much nicer to not have to redo the entire sync on 6 million files just to retry those 9000 files.

    It could be further improved by actually saving state to disk so we could retry failed uploads at a later time (maybe the internet connection goes down). Something similar to how the dd_rescue log works when copying a disk so it knows what blocks of the disk haven't been successfully copied yet and can keep retrying the failed blocks indefinitely.

  4. ncw commented on Aug 10, 2018

    @ncw
    Member

    @dlong500 wrote:

    This would be immensely helpful. I'm half way through syncing 6 million files to B2 and there are about 9000 errors so far. It would be so much nicer to not have to redo the entire sync on 6 million files just to retry those 9000 files.

    The major thing the complete sync has to do is do a directory listing both locally and remote which will be time consuming for 6M files. b2 supports --fast-list so if you have enough memory that is the way to go to speed it up.

    If you have a log you can parse the 9,000 errors out of it and then do a copy with --files-from (don't use --fast-list) and then rclone will do the minimum amount of directory traversals to copy those files.

    It could be further improved by actually saving state to disk so we could retry failed uploads at a later time (maybe the internet connection goes down). Something similar to how the dd_rescue log works when copying a disk so it knows what blocks of the disk haven't been successfully copied yet and can keep retrying the failed blocks indefinitely.

    At the moment rclone doesn't store any state - retrying the sync is it's recovery mechanism. This has the advantage of being simple and extremely reliable but the disadvantage that it has to do those remote directory listings.

  5. dlong500 commented on Aug 10, 2018

    @dlong500

    I agree that it is more simple/reliable without state, and that should likely stay the default option, but I do think for people with extremely large datasets that a state option could allow for much greater efficiency, reduce transaction charges, and allow for better recovery from temporary/transient environment problems. It doesn't have to be mutually exclusive either (you could always do a complete refresh and rebuild the local state, or even stop using the local state altogether). I wish I could contribute something myself. Maybe if I can ever get some time to start playing with Go...

    For now I'll try to use --fast-list, but this particular scenario is on a client machine that doesn't have a whole lot of memory, so I'll have to see how it goes.

  6. cezaryzukowski commented on Oct 8, 2019

    @cezaryzukowski

    @l-e-o-n-c-e @dlong500 What backend storage do you use?

    I think, we have the same issue.

    We found out that this magic number of 100K objects is associated with the sharding capability of the backend we test. Ceph performs resharding when there is more than 100K objects uploaded to a bucket (https://documentation.suse.com/ses/5.5/html/ses-all/cha-ceph-gw.html#ogw-bucket-sharding-dyn). This locks a bucket and cause the upload errors.

    Example error:
    2019-10-08 13:19:33 ERROR : xaaaaaamnha: Failed to copy: s3 upload: 404 Not Found: <?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchKey</Code><BucketName>bucket_sync_1M_E</BucketName><RequestId>tx0000000000000001b68c9-005d9c8cdf-d8a33-ops</RequestId><HostId>d8a33-ops-ops</HostId></Error>

    So, if you use for example Ceph and you know the number of objects in advance, you can shard a bucket before transferring, i.e. reshard it with accordance to the formula: https://documentation.suse.com/ses/5.5/html/ses-all/cha-ceph-gw.html#ogw-bucket-sharding-new

  7. 001101 commented on Jun 14, 2022

    @001101

    just insane that is has not implemented, if the log can verbose failed, why not simply write temp log file, make a listener for errors and write the filenames with path to tmp file for retry after transfer completed.

  8. trompx commented on May 21, 2024

    @trompx

    Hitting this issue right now. Was working perfectly and suddenly I started getting errors like:
    ERROR : <Filename>: error reading source directory: Error while authenticating request when syncing from dropbox to cloud storage.
    On 40gb I only have 10-20 errors most of the time but my backup keeps failing because even when it retries, there are still errors (which are not on the same files: I already tried to lower the --tpslimit to 1 and --transfers also to 1 but still getting the Error while authenticating request, so probably not a rate limit issue, but the message is not helpful at all) and increasing --low-level-retries up to 100 didn't work either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions