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
To detect that a directory was not changed, it would be good if (at least) every directory could provide a unique ID through a PROPFIND on the directory. The ID must never change, also not on rename.
The usecase is that clients will store the ID and use to detect if it's still the same ID or if the directory has changed. In that case the client journal needs to be deactivated.
This is an enhancement that we need to detect if people removed the server dir and recreated it with the same name.
Actually I need to correct myself here: We do not need an API to check if the server knows an file with a given ID. The reason is: We do the update phase as the first step, and than we know all IDs the server knows. Thanks to @ogoffart who pushed me on the right way.
The easiest way would be to change the etag to ensure that:
Two different files always have different etags.
The etag does not change when a file is moved or renamed.
(Note: using md5 as etag satify this properties)
Even if another field is used for unique id, the etag also need not to change when a file is moved because else we don't know if the file has just been moved, or if it has been moved AND modified
My previous comment was talking about files, not about directory.
But we probably do not need more for directories. Because if we detect that all files within a directory have been moved, that's enough not to download them again (they can all be moved one by one and that will be sufficiently fast)
But it wouold be perfect if:
Two different directories always have a different etag
The etag do not change when a directory is moved or renamed and no other change was done within the directory.
the etag of a directory does not change if it is moved (tested through cadaver)
all etags are different from each other for different file. Is that true @DeepDiver1975 ??
I think it will be an issue earlier or later if all files are moved separately. But I also think that if we can detect the moves of all files in the update phase, the new propagator will be able to be smart and find out the minimum amount of moves needed to achieve that.
Am Dienstag, dem 22.10.2013 um 19:09 schrieb dragotin:
This is status quo:
the etag of a directory does not change if it is moved (tested through cadaver)
all etags are different from each other for different file. Is that true @DeepDiver1975 ??
I think it will be an issue earlier or later if all files are moved separately. But I also think that if we can detect the moves of all files in the update phase, the new propagator will be able to be smart and find out the minimum amount of moves needed to achieve that.
Reply to this email directly or view it on GitHub: #3593 (comment)
Etags are not unique, they are currently unique within a single storage backend but mounting a backend twice gives you two files with the same etag, I also believe a shared file will have the same etag for every shared instance of the file.
Please turn the the two tupels around to put the faster changing part in front.
Please add the file ID as an additional header to the PUT reply similar to what we do with the etag. That saves additional requests. Please name it X-OC-FileID similar to the modification time.
Activity
karlitschek commentedon Jun 5, 2013
Makes sense. @icewind1991 @bartv2 What do you think?
danimo commentedon Oct 10, 2013
Any news here?
karlitschek commentedon Oct 10, 2013
why has this an engineering flag? Who did this?
icewind1991 commentedon Oct 10, 2013
There is the file ID which all folders have which stays the same after a rename. I'm not sure id that's exposed over webdav though
dragotin commentedon Oct 20, 2013
This is what a PROPFIND on a directory returns:
I don't think the id is promoted. Can we still add that to the oC6 codebase? Otherwise we can not detect renames while syncing.
karlitschek commentedon Oct 20, 2013
@icewind1991 Is it possible to add it?
DeepDiver1975 commentedon Oct 20, 2013
Should not be that hard @icewind1991 can you take care? Otherwise I'll hack this tomorrow - let me know. THX
DeepDiver1975 commentedon Oct 20, 2013
yes 😉
karlitschek commentedon Oct 20, 2013
Hehe. Same comment in the same second. Must be true ;-)
dragotin commentedon Oct 21, 2013
Actually I need to correct myself here: We do not need an API to check if the server knows an file with a given ID. The reason is: We do the update phase as the first step, and than we know all IDs the server knows. Thanks to @ogoffart who pushed me on the right way.
ogoffart commentedon Oct 22, 2013
The easiest way would be to change the etag to ensure that:
(Note: using md5 as etag satify this properties)
Even if another field is used for unique id, the etag also need not to change when a file is moved because else we don't know if the file has just been moved, or if it has been moved AND modified
ogoffart commentedon Oct 22, 2013
My previous comment was talking about files, not about directory.
But we probably do not need more for directories. Because if we detect that all files within a directory have been moved, that's enough not to download them again (they can all be moved one by one and that will be sufficiently fast)
But it wouold be perfect if:
dragotin commentedon Oct 22, 2013
This is status quo:
I think it will be an issue earlier or later if all files are moved separately. But I also think that if we can detect the moves of all files in the update phase, the new propagator will be able to be smart and find out the minimum amount of moves needed to achieve that.
DeepDiver1975 commentedon Oct 22, 2013
this is the function which is used:
http://php.net/manual/en/function.uniqid.php
Am Dienstag, dem 22.10.2013 um 19:09 schrieb dragotin:
icewind1991 commentedon Oct 22, 2013
Etags are not unique, they are currently unique within a single storage backend but mounting a backend twice gives you two files with the same etag, I also believe a shared file will have the same etag for every shared instance of the file.
ogoffart commentedon Oct 23, 2013
If the file is the same, then it is fine. Then we can optimize and do a copy locally instead of re-downloading.
icewind1991 commentedon Oct 23, 2013
I still wouldn't assume uniqueness of etag's, they are unique in the current implementation but there is no guaranty that that will remain that way.
Only file id's are guaranteed to be unique.
DeepDiver1975 commentedon Oct 23, 2013
as just discussed: I'll implement this ...
karlitschek commentedon Oct 23, 2013
you rock!
dragotin commentedon Oct 25, 2013
Two more requests:
X-OC-FileIDsimilar to the modification time.