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
touch file early after upload to avoid having wrong time #13498
When uploading a file from the sync client, the mtime is sent along.
After upload there is a short time window during which the final file still has the wrong mtime until touch() is created.
We need to look into making this happen earlier, to reduce the time during which the mtime is wrong (I don't think this can be eliminated properly, especially on external storages)
@PVince81
On February 8th I installed a fresh instance of OC server 7.0.4, no encryption, had some files uploaded and downloaded them via a shared folder to a client on a Win 8.1 PC. Client 1.8.0-nightly (build 4536).
Result: 328 files copied, 7 files with the wrong mdate (2% lost the original mtime)
Downloading a file should be 100% prevented as long as the original mtime is not properly set at the server.
Please have it solved quite soon!
It's a kind of data corruption and it's one of the bugs that prevents me from releasing OC for my group of users.
@PVince81
Just replacing one file. I can give it a try and test it.
Please give me a sign and a link when your discussions have resulted in a testable file.
Yes, by preventing concurrent requests to download the file while it is being worked on (protecting the final operations after upload which are "touch" and "rename" to the final file)
Seems like even doing a touch earlier before the cache update solves it. But there is still a small time window before the renaming from part file to final file and the touch.
Ideal would be to do the touch even before the rename, but might not work for the workaround case where there is either no part file or the part file is on a separate storage.
Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.
In general the file's actual mtime on disk isn't that relevant. What matters is the value of storage_mtime.
For external storages, if the mtime is wrong first it means a hasUpdated() call from another access will not sync the file as it has a future mtime before touch(). It isn't too bad, that shouldn't cause any negative side effects.
Activity
PVince81 commentedon Jan 20, 2015
@DeepDiver1975 setting to 8.1
VincentvgNn commentedon Feb 9, 2015
@PVince81
On February 8th I installed a fresh instance of OC server 7.0.4, no encryption, had some files uploaded and downloaded them via a shared folder to a client on a Win 8.1 PC. Client 1.8.0-nightly (build 4536).
Result: 328 files copied, 7 files with the wrong mdate (2% lost the original mtime)
Downloading a file should be 100% prevented as long as the original mtime is not properly set at the server.
Please have it solved quite soon!
It's a kind of data corruption and it's one of the bugs that prevents me from releasing OC for my group of users.
PeterPablo commentedon Feb 9, 2015
This client issue is related (owncloud/client#2743, previously tracked in owncloud/client#2401).
PVince81 commentedon Feb 9, 2015
@VincentvgNn mind retesting with #13985 ?
PVince81 commentedon Feb 9, 2015
Looks like @DeepDiver1975 was faster, but his change is more extensive: #13823
VincentvgNn commentedon Feb 9, 2015
@PVince81
Just replacing one file. I can give it a try and test it.
Please give me a sign and a link when your discussions have resulted in a testable file.
PVince81 commentedon Feb 9, 2015
@VincentvgNn yes, please hold. We might want to go with @DeepDiver1975's approach instead.
karlitschek commentedon May 4, 2015
This would be "solved" with high level locking, right?
PVince81 commentedon May 11, 2015
Yes, by preventing concurrent requests to download the file while it is being worked on (protecting the final operations after upload which are "touch" and "rename" to the final file)
4 remaining items
PVince81 commentedon Oct 29, 2015
Just tried on master / 9.0 pre-alpha, this is still an issue. Locking doesn't prevent that.
Steps to reproduce
sleep(10);here before touch: https://github.com/owncloud/core/blob/v8.2.0/lib/private/connector/sabre/file.php#L200cp -ainto the local data folder ("-a" makes it preserve its mtime)lsrepeatedly in the folderYou'll see that the file's mtime is first the latest mtime and after 10 seconds it changes back to the correct one.
I wonder if we can cover this simply by releasing the lock later @icewind1991 ?
PVince81 commentedon Sep 20, 2016
Still exists in 9.1.1RC3.
Seems like even doing a
touchearlier before the cache update solves it. But there is still a small time window before the renaming from part file to final file and the touch.Ideal would be to do the touch even before the rename, but might not work for the workaround case where there is either no part file or the part file is on a separate storage.
ownclouders commentedon Jan 13, 2018
Hey, this issue has been closed because the label
status/STALEis set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.(This is an automated comment from GitMate.io.)
PVince81 commentedon Jan 15, 2018
In general the file's actual mtime on disk isn't that relevant. What matters is the value of storage_mtime.
For external storages, if the mtime is wrong first it means a
hasUpdated()call from another access will not sync the file as it has a future mtime beforetouch(). It isn't too bad, that shouldn't cause any negative side effects.lock commentedon Jul 31, 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.