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
{{ message }}
Repository navigation
Store client's file checksum as metadata and return it again in downloads and PROPFIND #18716
partly secure again corruption on the storage layer
Limitations:
files are uploaded and created from several different sides. for example directly on the external storage. Because of that checksum are not always available or there generation would be too expensive. Because of that there are sometimes available and sometimes not. So checksums will be optional
Approach:
Everytime a clients who supports this feature. (the ownCloud Desktop Client in the first step) can send a checksum of the file in parallel with the payload.
The ownCloud server stores this checksum in the file cache table
If a checksum for a file is available in the filecache table then this value is returned with every propfind.
The client can then compare the checksum and detect possible corruption of the file.
In this first step of the checksumming no checksums are generated on the server side. The server acts purely as a storage at the moment. In the later stage this could be extended.
Because checksums are not always available and are completely optional the clients can't rely on them for the actual syncing algorithm.
This approach can be extended in different directions in the future but we should start with this step.
The client-side ticket is owncloud/client#3735. When this is added to the server, please also add a list of supported checksumming algorithms to the capabilities API. The client currently supports "Adler32", "MD5" and "SHA1".
You can already ask the client to send checksums for uploads by adding transmissionChecksum=MD5 to the [General] section of owncloud.cfg.
changed the title [-]Store client's file checksum as metadata and return it again[/-][+]Store client's file checksum as metadata and return it again in downloads and PROPFIND[/+]on Oct 2, 2015
Regarding filecache table: I heard that adding a column on an existing table that has 10K or more entries might be slow at update time. So we might also need to consider a separate table.
But I'm not database expert. 😄
I'd suggest a detail table with colums fileId, checksumtypeId and checksum, with primary key (fileId, checksumtype) and another detail table mapping checksumtypeId to a meaningful string.
I'd suggest a detail table with colums fileId, checksumtypeId and checksum, with primary key (fileId, checksumtype) and another detail table mapping checksumtypeId to a meaningful string.
So far, the client never asks for the checksum in PROPFINDs. As a result, the checksum is never returned in a PROPFIND result and thus does not need to be read from database for the normal PROPFIND usecase.
For the current functionality, the client does not need the content checksum at all. So far we agreed to only use the checksum for transportation verification. For that, the checksum is contained in a HTTP header of the PUT or GET request, and from there the client is reading it.
For change detection of server files, we continue to rely on the ETags which makes sense. So I currently see no reason why the client would EVER ask for the checksum of the whole file in a PROPFIND. It is very good to have that for special cases but not for the normal case.
Let me kindly ask for re-considering to store multiple checksums in a detail table rather than in one column in oc_filecache given these facts.
Even if it is outside of this feature, it would be good to have
implemented checksum verification by client as an additional option on
top of ETags (or in parallel).
Dreaming further, it would be good to be able to sync differences within
files only (using rolling checksum window, similar to DropBox and rsync).
Regards,
David
On 2016-02-18 11:26, Klaas Freitag wrote:
Just for the record:
So far, the client never asks for the checksum in PROPFINDs. As a
result, the checksum is never returned in a PROPFIND result and thus
does not need to be read from database for the normal PROPFIND usecase.
For the current functionality, the client does not need the content
checksum at all. So far we agreed to only use the checksum for
transportation verification. For that, the checksum is contained in a
HTTP header of the PUT or GET request, and from there the client is
reading it.
For change detection of server files, we continue to rely on the ETags
which makes sense. So I currently see no reason why the client would
EVER ask for the checksum of the whole file in a PROPFIND. It is very
good to have that for special cases but not for the normal case.
Let me kindly ask for re-considering to store multiple checksums in a
detail table rather than in one column in oc_filecache given these facts.
—
Reply to this email directly or view it on GitHub #18716 (comment).
After further discussion with @dragotin we will for now keep the current approach because it is simply enough for what we are trying to accomplish for 9.0
Even if storage backends can provide multiple checksums - the question is if we really need to store them in out database.
Assuming we once want to verify the checksums between owncloud and the storage system - I see no need in storing them because the checksums are only evaluated on upload to the storage.
The checksum send from/to the client is for a different scenarios/part of the workflow.
Activity
karlitschek commentedon Aug 31, 2015
@dragotin @danimo @guruz @ogoffart FYI @DeepDiver1975
karlitschek commentedon Aug 31, 2015
@MTRichards
aspdye commentedon Aug 31, 2015
👍
PVince81 commentedon Sep 16, 2015
Sounds great 😄
ckamm commentedon Oct 1, 2015
The client-side ticket is owncloud/client#3735. When this is added to the server, please also add a list of supported checksumming algorithms to the capabilities API. The client currently supports "Adler32", "MD5" and "SHA1".
You can already ask the client to send checksums for uploads by adding
transmissionChecksum=MD5to the [General] section of owncloud.cfg.[-]checksum support[/-][+]Store client's file checksum as metadata and return it again[/+][-]Store client's file checksum as metadata and return it again[/-][+]Store client's file checksum as metadata and return it again in downloads and PROPFIND[/+]dragotin commentedon Oct 19, 2015
I would suggest that both client and server work with a HTTP header of the form:
Currently we support the checksum types
MD5,SHA1andAdler32PVince81 commentedon Dec 7, 2015
@dragotin is the client already sending something ?
TODO for the server:
dragotin commentedon Dec 7, 2015
yes, since 2.1.0 the client sends either Adler32 (probably not useful), MD5 or SHA1 if you enable it in the config file by setting:
in the
[General]section.icewind1991 commentedon Dec 7, 2015
I would say so yes
1 remaining item
PVince81 commentedon Dec 7, 2015
Regarding filecache table: I heard that adding a column on an existing table that has 10K or more entries might be slow at update time. So we might also need to consider a separate table.
But I'm not database expert. 😄
dragotin commentedon Dec 7, 2015
I'd suggest a detail table with colums
fileId, checksumtypeIdandchecksum, withprimary key (fileId, checksumtype)and another detail table mapping checksumtypeId to a meaningful string.icewind1991 commentedon Dec 8, 2015
Makes more sense yes
DeepDiver1975 commentedon Dec 8, 2015
should be of lesser issue if the column is nullable
rullzer commentedon Feb 3, 2016
#21997 is in.
Documentation ticket in https://github.com/owncloud/documentation/issues/2132
And ticket for QA intergration tests in owncloud/QA#113
rullzer commentedon Feb 8, 2016
Closing time :)
MorrisJobke commentedon Feb 9, 2016
Proper return values for multiple checksums went in as #22199
dragotin commentedon Feb 18, 2016
Just for the record:
So far, the client never asks for the checksum in PROPFINDs. As a result, the checksum is never returned in a PROPFIND result and thus does not need to be read from database for the normal PROPFIND usecase.
For the current functionality, the client does not need the content checksum at all. So far we agreed to only use the checksum for transportation verification. For that, the checksum is contained in a HTTP header of the PUT or GET request, and from there the client is reading it.
For change detection of server files, we continue to rely on the ETags which makes sense. So I currently see no reason why the client would EVER ask for the checksum of the whole file in a PROPFIND. It is very good to have that for special cases but not for the normal case.
Let me kindly ask for re-considering to store multiple checksums in a detail table rather than in one column in oc_filecache given these facts.
bugsyb commentedon Feb 18, 2016
Even if it is outside of this feature, it would be good to have
implemented checksum verification by client as an additional option on
top of ETags (or in parallel).
Dreaming further, it would be good to be able to sync differences within
files only (using rolling checksum window, similar to DropBox and rsync).
Regards,
David
On 2016-02-18 11:26, Klaas Freitag wrote:
DeepDiver1975 commentedon Feb 18, 2016
After further discussion with @dragotin we will for now keep the current approach because it is simply enough for what we are trying to accomplish for 9.0
Even if storage backends can provide multiple checksums - the question is if we really need to store them in out database.
Assuming we once want to verify the checksums between owncloud and the storage system - I see no need in storing them because the checksums are only evaluated on upload to the storage.
The checksum send from/to the client is for a different scenarios/part of the workflow.
dragotin commentedon Mar 29, 2016
I think this is the important bit to fix #11811
lock commentedon Aug 5, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.