-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PropagateDownload: Skip identical files more #6168
Conversation
a3baa57
to
caac544
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that the checksum might not be sufficiently good.
Before, we were considering that the fact that the size and mtime was the same was a sufficiently good indication that the file was similar.
But now, if the mtime is also different, this is too much to just rely on the checksum.
src/libsync/propagatedownload.cpp
Outdated
// compare the remote checksum to the local one. | ||
// Maybe it's not a real conflict and no download is necessary! | ||
if (_item->_instruction == CSYNC_INSTRUCTION_CONFLICT | ||
&& _item->_size == _item->_previousSize | ||
&& _item->_modtime == _item->_previousModtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd change that to
_item->_modtime == _item->_previousModtime || isChecksumSufficientlyGood
Use case to check the mtime here, is that if somebody deletes the database and do a sync again, not everything should be conflictsn even if there is no hashes or that the hashes are week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve @ckamm changes.
Note I pushed a test commit in the branch.
Previously we required matching mtimes but that's actually unnecessary when the question is about whether to skip the download. We will still update the file's metadata. Also, adjust behavior when the checksum is weak (Adler32): in these cases we still depend on equal mtimes.
81f16f1
to
2dd50fc
Compare
Previously we required matching mtimes but that's actually
unnecessary when the question is about whether to skip the
download. We will still update the downloaded file's metadata.
See #6153