You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to #3235 and #2983 we use content checksums for detecting unnecessary uploads and renames-that-aren't. But content checksums are currently only computed for .eml files.
We should consider enabling content checksumming for everything.
I still vote for using a safe cryptograpgical checksum so we can later use it for more advanced magic.
But if @ckamm says we can anyway later switch...
Other jobs that need to be done to expand our use of checksums:
Does the 'transmission checksum' vs 'content checksum' distinction make sense? Currently the server only sees the 'transmission checksum' and we discard the checksum we get from the server because the journal only stores the 'content checksum'.
Ensure we have a content checksum for downloaded files: either use the checksum the server sends or compute it after downloading.
Please consider that some storage backends such as ours already have a preferred checksum (adler32 in our case). It may be impossible for us to change the checksum type. More precisely, we have a technical ability to change the checksum type (for new files) but we may be constrained to do so by other considerations/policies. And also, consider that currently all our files are already checksummed with adler32 so any checksum type change could only apply to new files (so we would have a mix of checksum types in the system).
The adler32 checksum is not efficient for change detection for small files. Hence using it as content checksum may be problematic for files smaller than a given size (say 1KB). Also, consider this especially if you think in the future of storing checksum blocks which are by definition rather small. So if we want to avoid to compute additional content checksum then the content checksum mechanism with adler32 should be only enabled for files above the critical size (meaning that below that size you should count with a possibility of collision and false-positive). So that would option one but it is not optimal because it would not work for very small files (which I guess defeats the purpose for *.eml files).
So I think at least for us the distinction between content and transmission checksum makes sense. What is currently called a transmission checksum is actually enforced by the server and client cannot change it (another example: MD5 for Amazon S3). What is called content checksum is actually what client wants to use locally to achieve better operation with local change detection. In some cases both can be aligned, in other cases they cannot.
If we wanted to add additional content checksum than I would suggest:
on PUT: also send it as additional special header (e.g. OC-Client-Content-Checksum) just in case server decided to make use of this information in some way (or just store it as additional metadata). I would only consider to add this header unless you think that it is a better implementation choice to avoid the second pass on the client.
on GET: if transmission checksum does not match the type you expect you should compute the content checksum yourself and store locally. You may want to consider to store also the transmission checksum in case some correlation between the client and server checksums would be needed. This checksum however, is not normally needed by the client and should be included in a way which does not increase the memory footprint of the client (if that's possible at all)
I am open to discuss it further, these are just a bunch of initial thoughts but the initial constraints I described are valid.
Activity
guruz commentedon Jan 20, 2016
👍
I still vote for using a safe cryptograpgical checksum so we can later use it for more advanced magic.
But if @ckamm says we can anyway later switch...
@LukasReschke @ogoffart What do you think?
dragotin commentedon Jan 20, 2016
@moscicki your input here?
guruz commentedon Jan 20, 2016
Maybe also from @PVince81 and @DeepDiver1975 about storage backends (on the server) natively supporting certain checksums so we can align with them.
ckamm commentedon Jan 20, 2016
Discussion on IRC regarding checksum type:
ckamm commentedon Jan 20, 2016
Other jobs that need to be done to expand our use of checksums:
moscicki commentedon Jan 20, 2016
Please consider that some storage backends such as ours already have a preferred checksum (adler32 in our case). It may be impossible for us to change the checksum type. More precisely, we have a technical ability to change the checksum type (for new files) but we may be constrained to do so by other considerations/policies. And also, consider that currently all our files are already checksummed with adler32 so any checksum type change could only apply to new files (so we would have a mix of checksum types in the system).
The adler32 checksum is not efficient for change detection for small files. Hence using it as content checksum may be problematic for files smaller than a given size (say 1KB). Also, consider this especially if you think in the future of storing checksum blocks which are by definition rather small. So if we want to avoid to compute additional content checksum then the content checksum mechanism with adler32 should be only enabled for files above the critical size (meaning that below that size you should count with a possibility of collision and false-positive). So that would option one but it is not optimal because it would not work for very small files (which I guess defeats the purpose for *.eml files).
So I think at least for us the distinction between content and transmission checksum makes sense. What is currently called a transmission checksum is actually enforced by the server and client cannot change it (another example: MD5 for Amazon S3). What is called content checksum is actually what client wants to use locally to achieve better operation with local change detection. In some cases both can be aligned, in other cases they cannot.
If we wanted to add additional content checksum than I would suggest:
I am open to discuss it further, these are just a bunch of initial thoughts but the initial constraints I described are valid.
AnrDaemon commentedon Jan 24, 2016
A wishful note: Using two differently calculated checksums against same file often increase reliability.
dragotin commentedon Feb 25, 2016
Hm, I got pointed to this: https://tools.ietf.org/html/rfc3230
Maybe we should be compatible?
dragotin commentedon Feb 29, 2016
Created owncloud/core#22711 about this.
Checksums: Content checksums for all uploads owncloud#4375
Checksums: Compute content checksum on download owncloud#4375
ckamm commentedon Mar 2, 2016
Pull request #4532
moscicki commentedon Mar 2, 2016
Hello,
In 1.7.2 we have the content checksums implemented and enabled. Will this pull request affect the current transmission checksum implementation?
Thank you,
kuba
ckamm commentedon Mar 3, 2016
@moscicki This has no effects on transmission checksums, it's only about checksums that the client stores in its database.
Merge pull request #4532 from ckamm/content-checksum
guruz commentedon Apr 6, 2016
-> #4638
Checksums: Compute content checksum on download #4375