Repository navigation
Conversation
ncw
left a comment
There was a problem hiding this comment.
This patch looks like a sensible idea - thank you :-)
I'm slightly concerned about changing the behaviour when using backends which don't support modtimes or checksums.
I'd like a bit more background if possible.
How did you notice that this was a problem?
Can you give me a recipe for making a duplicate upload? So I can try it here.
If so then we could make a test for it too.
Thank you
The Equal() is already being used elsewhere(iirc such as rclone copy), so it shouldn't be a problem.
I use rclone mount with a google drive backend. When I write the same content to a file as itself, a new revision of the file will be generated on drive.google.com if without the patch. |
Can you try this test with your patch? Run and And then try overwriting a file on the FTP server with a file that is the same size If you do this with your patch the file won't get uploaded. This is because FTP remotes don't support modification times.
I see. So what is happening is that Equal is saying that the modtimes are different, then doing remote and local checksums and seeing they are identical and not uploading. Perhaps what we should be doing is calling rclone/fs/operations/operations.go Line 55 in 2bc2546 And if This is slightly annoying duplication of the logic in Whatever logic we decide on it needs a test :-) Another thought crosses my mind - how common is it to alter a file and leave it the same? This patch makes us checksum every file we are about to update which potentially slows everything down. |
rclone/fs/operations/operations.go Lines 226 to 229 in f1f923a It seems the case that remote does not support checksum is catched in equal().
Perhaps check modtime & size is enough and only do hash check when edit: I was just realized that modtime is always different as a vfs sync only happens when files change, so what do you think about this wloot@0476432 |
This is actually common in my use case, emby writes same content to metadata file within almost every check cycle, in the meantime there are thousands of metadata files. |
|
This patch fixes a corner case and has potential to break stuff for a lot of existing cases/ cc @ncw |
|
If this ever gets accepted, |
|
Captured the requested behavior as a new user case in #4810 (comment) |
|
In its current form, this PR cannot be accepted. P.S. Generally, the change detection logic in rclone has come to the verge of unsupportable - every new optimization brings more and more risk to break something. It requires deeper overall discussion rather than the stream of small per-user-case optimizations. |
What is the purpose of this change?
Was the change discussed in an issue or in the forum before?
Checklist