Skip to content

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

Closed

Description

@PVince81

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 ?

Activity

  1. MorrisJobke commented on Aug 3, 2015

    @MorrisJobke
    Contributor

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

  2. PVince81 commented on Aug 3, 2015

    @PVince81
    ContributorAuthor

    Yes

  3. MorrisJobke commented on Aug 3, 2015

    @MorrisJobke
    Contributor

    Info: This was fixed in 8.1.0

  4. locked as resolved and limited conversation to collaborators on Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions