{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/11734","labels_url":"https://api.github.com/repos/owncloud/core/issues/11734/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/11734/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/11734/events","html_url":"https://github.com/owncloud/core/issues/11734","id":46618736,"number":11734,"title":"Update file cache before renaming part file to final file","user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-10-23T12:26:02Z","updated_at":"2015-08-03T09:22:13Z","closed_at":null,"body":"See original issue here: https://github.com/owncloud/mirall/issues/2378#issuecomment-60230111\r\n\r\nCurrently (in OC 7.0.3 RC1) whenever a part file gets renamed to the final file, the file cache is updated.\r\nIf the cache update fails (due to \"database is locked\" or other issues), the file is still renamed to the target file.\r\nA 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.\r\n\r\nOne 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.\r\n\r\nThe 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.\r\n\r\n@icewind1991 what do you think ?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/127174962","html_url":"https://github.com/owncloud/core/issues/11734#issuecomment-127174962","issue_url":"https://api.github.com/repos/owncloud/core/issues/11734","id":127174962,"user":{"login":"MorrisJobke","id":245432,"avatar_url":"https://avatars.githubusercontent.com/u/245432?v=3","gravatar_id":"","url":"https://api.github.com/users/MorrisJobke","html_url":"https://github.com/MorrisJobke","followers_url":"https://api.github.com/users/MorrisJobke/followers","following_url":"https://api.github.com/users/MorrisJobke/following{/other_user}","gists_url":"https://api.github.com/users/MorrisJobke/gists{/gist_id}","starred_url":"https://api.github.com/users/MorrisJobke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorrisJobke/subscriptions","organizations_url":"https://api.github.com/users/MorrisJobke/orgs","repos_url":"https://api.github.com/users/MorrisJobke/repos","events_url":"https://api.github.com/users/MorrisJobke/events{/privacy}","received_events_url":"https://api.github.com/users/MorrisJobke/received_events","type":"User","site_admin":false},"created_at":"2015-08-03T09:22:13Z","updated_at":"2015-08-03T09:22:13Z","body":"@PVince81 Isn't this fixed with high level file locking? :)"}}