Skip to content

Cache inconsistency with FS when deleting/restoring versions #11935

Closed

Description

@PVince81

Steps to reproduce

  1. Create a file "test.txt"
  2. Edit then save the file multiple times to create versions
  3. Check versions in the versions dropdown
  4. Check database: select * from oc_filecache where path like '%/test.txt%';
  5. Delete file "test.txt"
  6. Check database again
  7. Restore file "test.txt"
  8. Check database again

Expected result

At step 4 the versions are listed under "files_versions" in the database.
At step 6 the versions are listed under "files_trashbin/versions".
At step 8 the versions are back under "files_versions".

Actual result

At step 6 the versions are STILL under "files_versions" even though in the filesystem they are under "files_trashbin/versions".
At step 8 the versions are now under "files_trashbin/versions" even though in the filesystem they are back under "files_versions".

Versions

ownCloud 7 stable7 (f718e88) and also on master (6f0c814)

This issue doesn't seem to break functionality, but who knows what side effects it could cause.

I remember that @icewind1991 added a change that made the scanner also work for files_versions and files_trashbin. I'd expect that if the trashbin uses $view operations the cache would update automatically. @schiesbn any idea ?

Activity

  1. PVince81 commented on Mar 2, 2015

    @PVince81
    ContributorAuthor

    The question is also why we need rescanning of versions in the first place, this: https://github.com/owncloud/core/blob/stable7/apps/files_trashbin/lib/trashbin.php#L889

    This means rescanning might happen for every file upload that triggers trashbin expiration and could cause CPU spikes: #11240 (comment)

  2. PVince81 commented on Aug 21, 2015

    @PVince81
    ContributorAuthor

    I think this has been fixed in OC 8.

    Also in OC 8.1 the trashbin expiration happens in a background job, and the scanning has been optimized.

  3. locked as resolved and limited conversation to collaborators on Aug 9, 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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions