-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Rename a folder during upload race condition #11795
Comments
Setting to showstopper/gold as per original, but I don't think this should block the release. Ideally a high-level file operation locking mechanism needs to be designed and developed to avoid such concurrency issues. |
A showstopper is something that blocks the release. It it doesn´t block the release than it´s not gold/showstopper. Please make up your mind :-) |
Yes, I just wasn't sure whether I could simply remove the gold label as I didn't get any feedback so far. |
CC @jnfrmarks for an "interesting" test case. The symtoms/results change based on the timing. |
Tested with high-level file locking #16237 Let's think about the locking case from #16237: since we're uploading multiple files, there are two possible conditions, either:
So far I only managed to meet condition 2) with the steps above, which doesn't seem to work properly yet with high-level file locking. It currently doesn't work, probably because small files (I used files < 20 MB) are going directly to the storage. |
@cmonteroluque we probably also want this assigned to 8.1 (because I don't see why #13391 is but not this one here) |
@cmonteroluque Ping |
I retested with #17017 and #16963 combined and couldn't reproduce any loss. Either the rename tells me the folder is locked, which means a file operation is pending. Or the client cannot find the target folder since I renamed it. However, it might happen that a second folder got created with some files in it from the first try. This is not something we can avoid at this level of locking. But I think the most important thing is that no file is going missing. They all still had their copy available in the original folder, which the sync client simply reuploaded. |
Steps to reproduce
Expected result
All files uploaded to "A2"
Actual result
About 90% of the time, there will be two folders "A" and "A2" where part of the files go to "A" and the other part to "A2". Sometimes some files are even missing.
See owncloud/client#2296 for LOTS of details about my debugging results.
Basically there seems to be a time window during which the FS update doesn't match the cache (because it hasn't been updated yet). If in that time window a concurrent call runs
scanFile()
, it will find the mtime different on disk and interpret the folder "A2" as a new folder and it will make a new entry for it in the cache, even though "A" is still there.The text was updated successfully, but these errors were encountered: