Skip to content
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

Update file cache before renaming part file to final file #11734

Closed
PVince81 opened this issue Oct 23, 2014 · 4 comments
Closed

Update file cache before renaming part file to final file #11734

PVince81 opened this issue Oct 23, 2014 · 4 comments
Labels

Comments

@PVince81
Copy link
Contributor

See original issue here: owncloud/client#2378 (comment)

Currently (in OC 7.0.3 RC1) whenever a part file gets renamed to the final file, the file cache is updated.
If the cache update fails (due to "database is locked" or other issues), the file is still renamed to the target file.
A subsequent scan will find the mtime/size difference and think the file changed (since the change wasn't in the cache) and it will update the cached metadata, including etag. This will cause the client to redownload the file.

One possible solution for this would be to update the cache BEFORE renaming the part file to the final file. Only if the cache update worked, rename the part file.

The worst that happens in such cases is that the file is redownloaded and causes additional traffic (no data corruption), then the sync client finds that the downloaded file matches the local file and discards it.

@icewind1991 what do you think ?

@MorrisJobke
Copy link
Contributor

@PVince81 Isn't this fixed with high level file locking? :)

@PVince81
Copy link
Contributor Author

PVince81 commented Aug 3, 2015

Yes

@PVince81 PVince81 closed this as completed Aug 3, 2015
@MorrisJobke
Copy link
Contributor

Info: This was fixed in 8.1.0

@PVince81
Copy link
Contributor Author

PVince81 commented Aug 3, 2015

@lock lock bot locked as resolved and limited conversation to collaborators Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants