Repository navigation
Conversation
ncw
left a comment
There was a problem hiding this comment.
The code looks OK, however docs are missing from docs/content/docs.md
What this flag does is
While syncing, if the size matches and the modtime is different then assume the files are equal without doing a checksum test. This then sets the modification time of the destination file unless --no-update-modtime
I have a problem with the name --no-checksum - it isn't descriptive enough for a flag which probably should never be used by the average user
I also have a problem working out why you would ever want this flag. If you set the flag then you are effectively matching sizes on the source and dest and if they are equal then you are setting the modification time on the dest. This is a really unreliable sync! So it has the worst parts of the --size-only sync.
I need a really good use case for this flag to go in the docs if it is to be merged.
I use the flag on rclone copy. I know if not check sum, it's really unreliable. But user know the source and dest are the same, only mtime is not same, It's no need to check sum. Because of more check sum operation will cause more read pressure on backend storage . |
Signed-off-by: zhuc <[email protected]>
|
Remaining open items:
|
|
@ivandeex Is there better suggestion name for the flags? I thinks we can determine the name first and add docs to it. |
ncw
left a comment
There was a problem hiding this comment.
Let's think about what to call this...
Firstly exactly what does it do
While syncing, if the size matches and the modtime is different then assume the files are equal without doing a checksum test. This then sets the modification time of the destination file unless --no-update-modtime
This flag reminds me of --refresh-times which has the help
The --refresh-times flag can be used to update modification times of existing files when they are out of sync on backends which don't support hashes.
So maybe this flag should be called --refresh-times-ignore-checksum
Which would make its help something like
The --refresh-times-ignore-checksum flag can be used to update modification times of existing files when they are out of sync. It works like --refresh-times except it doesn't attempt to check checksums. Instead if the size only of the source and destination files match then it will update the modification time in the destination.
We could also possibly change the --refresh-times flag to do what this flag does. It emphasises in the help that --refresh-times should only be used on backends which don't support checksums, so all existing uses should have ht == hash.None always and --refresh-times is equivalent to --refresh-times-ignore-checksum.
if !ci.NoCheckSum {
// Check if the hashes are the same
same, ht, _ := CheckHashes(ctx, src, dst)
if !same {
fs.Debugf(src, "%v differ", ht)
return false
}
if ht == hash.None && !ci.RefreshTimes {
// if couldn't check hash, return that they differ
return false
}
}So another possibility would be to move the check of ci.RefreshTimes into the place we hae ci.NoChecksum now.
This would mean then we only have just the one crazy --refresh-times flag.
Thoughts? @ivandeex ?
| flags.StringArrayVarP(flagSet, &downloadHeaders, "header-download", "", nil, "Set HTTP header for download transactions") | ||
| flags.StringArrayVarP(flagSet, &headers, "header", "", nil, "Set HTTP header for all transactions") | ||
| flags.BoolVarP(flagSet, &ci.RefreshTimes, "refresh-times", "", ci.RefreshTimes, "Refresh the modtime of remote files.") | ||
| flags.BoolVarP(flagSet, &ci.LogSystemdSupport, "log-systemd", "", ci.LogSystemdSupport, "Activate systemd integration for the logger.") |
There was a problem hiding this comment.
There seems to be a spurious addition here?
It's ok. Any other thoughts or suggestions? |
|
The use cases: There is only "incremental write" in source backend, only the mtime of the file in source backend maybe modified, so we only need to check size or mtime, no need to checksum, if there are many files on the source backend, checksum will cause many pressure on source backend;This is customer's real case. @ncw |
|
@ncw marking "regional" as I expect this thread to take long |
The problem here is that we don't understand what problem you are trying to solve and why you use the sequence of _if_s you use. Other people who use rclone will be happy to understand what this feature can do for them, too. Otherwise it's going to be your private flag, which is useless for others.
As long as I don't have any insight, I will internally call this flag Or
This is actually a description of the sequence of conditional statements in the patch, not a use case. I'll try to shed some light again. Generally I can see that you do something large and exotic, bigdata or something like that. "many" - What is amount of data? Several petabyte-size objects or millions of megabyte-size objects or what? Without answering at least some of these questions I don't understand how we can test this change or measure its success. Last but not least - testing. You didn't write any unit test for your feature. Does the current integration test pass with this flag on, at least? |
|
Copy-pasting here another attempt (from linked issue) by @ncw to understand what's going on in your testbed
(See my question above about other tools you've tried to resolve your unspoken task.....) That thread had more proposals from @ncw for the flag name
Bottomline:
Yes, plenty of thoughts, request for docs and four suggestions for flag name. |
|
@zhucan ping |
|
@zhucan |
I'm sorry, now, I have no time to do this, I will do it out of day |
|
Closing as abandoned |
What is the purpose of this change?
add option to always skip hashsum check
Was the change discussed in an issue or in the forum before?
#4793
Checklist