Skip to content

accounting: merge checkers and transfers #6797

Open

Description

@ncw

In 019a486 and 9baa4d1 we made an effort to show what checkers and transfers are doing better.

However, as discussed in https://forum.rclone.org/t/what-is-rclone-checking-during-a-purge/35931 this needs more work.

In order to do this work properly, the checkers and transfers need to be unified into a single datastructure. They need to be properly reference counted.

If a transfer is started, then if a checker is started on the same file then it should return the existing transfer but update the tag while the checker is running.

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 v1.63 milestone on Mar 1, 2023
  2. modified the milestones: v1.63, v1.64 on Jul 1, 2023
  3. nielash commented on Aug 25, 2023

    @nielash
    Contributor

    Just wanted to mention, in case it's related to the work you're planning here, that it would be really helpful for future bisync work to have an easy way to access a complete list of transfers. Similar to accounting.Stats(ctx).Transferred(), but that one is limited to MaxCompletedTransfers (100) and doesn't include modtime or hash. My hope is to use this to avoid having to re-list each fs at the end of a bisync run to find out what happened during the syncCopyMove operations, as re-listing is more expensive and error-prone.

    If this maybe already exists and I'm missing it, please let me know 😃 I see how to access the total number of transfers/errors, but we would need a list to reconcile it with the initial directory listings to build the "after" snapshot. If keeping the full transfer list in memory is a concern, we could potentially work with just a list of errored transfers (and infer that anything not on this list was successful and now matches what we passed in.) But this is not entirely foolproof, as it leaves open the possibility that files changed in between the listing and copying.

  4. ncw commented on Aug 26, 2023

    @ncw
    MemberAuthor

    @nielash wrote:

    Just wanted to mention, in case it's related to the work you're planning here, that it would be really helpful for future bisync work to have an easy way to access a complete list of transfers. Similar to accounting.Stats(ctx).Transferred(), but that one is limited to MaxCompletedTransfers (100) and doesn't include modtime or hash. My hope is to use this to avoid having to re-list each fs at the end of a bisync run to find out what happened during the syncCopyMove operations, as re-listing is more expensive and error-prone.

    That isn't quite what is under discussion here, but what I think you want is something like we have for operations.Check where you can pass in io.Writers to have the file names written to.

    type CheckOpt struct {
    	Fdst, Fsrc   fs.Fs     // fses to check
    	Check        checkFn   // function to use for checking
    	OneWay       bool      // one way only?
    	Combined     io.Writer // a file with file names with leading sigils
    	MissingOnSrc io.Writer // files only in the destination
    	MissingOnDst io.Writer // files only in the source
    	Match        io.Writer // matching files
    	Differ       io.Writer // differing files
    	Error        io.Writer // files with errors of some kind
    }
    

    If you read the docs for rclone check you'll see the bits about outputting file names to files. People have asked for exactly this for sync/copy/move and I think this internal inteface would suit your requirements too.

    I should probably change the io.Writer into a func(remote string) error to explicitly say it will be called with a path each time. We'd need a way of signalling high level retries also as the functions potentially get called each high level retry.

  5. nielash commented on Sep 5, 2023

    @nielash
    Contributor

    what I think you want is something like we have for operations.Check where you can pass in io.Writers to have the file names written to.

    Yes, this would be great! (I used this recently in 5ca61ab.) For bisync purposes I think we'd also need the size, modtime, and hash in addition to the list of names (at least to the extent that syncCopyMove already has this info -- and I think it does, as that's how it knows if a file is "corrupted on transfer".)

    But apologies for interrupting your unrelated ticket -- I'll get out of it now 🙂

  6. ncw commented on Sep 5, 2023

    @ncw
    MemberAuthor

    @nielash do you want to make a new issue about this?

  7. nielash commented on Sep 6, 2023

    @nielash
    Contributor

    @nielash do you want to make a new issue about this?

    Done 👍 #7282

  8. modified the milestones: v1.64, v1.65 on Sep 11, 2023
  9. modified the milestones: v1.65, v1.66 on Jan 3, 2024
  10. modified the milestones: v1.66, v1.67 on Mar 10, 2024
  11. eharris commented on Jun 11, 2024

    @eharris
    Contributor

    This is definitely needed. I was quite confused when I had --progress only show 8 transfers (which I discovered were actually checkers) when I had specified 20 transfers on the command line, and was slowing down the sync progress unnecessarily.

  12. modified the milestones: v1.67, v1.68 on Jul 1, 2024
  13. modified the milestones: v1.68, Soon on Aug 16, 2024
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