Skip to content

Add repair step to delete file cache when storage entry is gone #7874

Closed

Description

@PVince81

Delete all "oc_filecache" entries where there is no matching entry in the "oc_storages" table.

This could happen after running #7539 but also in some other cases or old bugs where the oc_filecache for deleted users wasn't deleted.

Activity

  1. PVince81 commented on Mar 25, 2014

    @PVince81
    ContributorAuthor

    Also remove the matching share entries. That would prevent "ghost" share entries to appear on other user's file system.

  2. PVince81 commented on Mar 25, 2014

    @PVince81
    ContributorAuthor

    Just noticed that the sharing app has something to clear broken shares (#7293), so that part might not be needed, or could be moved into a repair class instead. The goal being to be able to do this repair any time.

  3. added this to the milestone on Sep 5, 2014
  4. PVince81 commented on Sep 5, 2014

    @PVince81
    ContributorAuthor

    @MTRichards @craigpg setting to OC 7 backlog

  5. MTRichards commented on Sep 5, 2014

    @MTRichards
    Contributor

    So this is a maintenance script? Or CRON?
    My understanding was that some events triggered the scanfiles() on an account, one being it sensing it was out of sync. Trying to figure out how this is different...

  6. PVince81 commented on Sep 8, 2014

    @PVince81
    ContributorAuthor

    @MTRichards I should have called it "repair step".
    This would be a repair step that runs during upgrade, or whenever the admin runs ./occ maintenance:repair.

    The other command, ./occ files:scan will repair individual entries as long as there is an entry in oc_storages.
    Here the goal is to remove ALL entries in oc_filecache for which there is no more entry in oc_storages.

    I don't think files:scan can fix that. Can you confirm @icewind1991 ?

  7. changed the title [-]Add repair script for orphaned file cache entries[/-] [+]Add repair step to delete file cache when storage entry is gone[/+] on Sep 8, 2014
  8. PVince81 commented on Sep 8, 2014

    @PVince81
    ContributorAuthor

    This situation can happen on setups where the admin manually deletes storage entries, for example when trying to recover from the legacy home storage issue, basically deleting the entries in oc_storages for legacy home storages but possibly forgetting to remove the matching oc_filecache and oc_share entries.

  9. MTRichards commented on Sep 8, 2014

    @MTRichards
    Contributor

    Ok, understood. Seems like a good step, but not critical path for immediate release. Got it.

  10. icewind1991 commented on Sep 8, 2014

    @icewind1991
    Contributor

    I don't think files:scan can fix that. Can you confirm @icewind1991 ?

    Yes, the scanner doesn't touch any entries from storages that aren't mounted or no longer exist

  11. modified the milestones: , backlog on Jan 8, 2015
  12. PVince81 commented on Jan 14, 2015

    @PVince81
    ContributorAuthor

    @DeepDiver1975 setting to 8.1, it's about time we implemented this.
    Please set to backlog if not acceptable.

  13. modified the milestones: , backlog on Jan 14, 2015
  14. MorrisJobke commented on Apr 9, 2015

    @MorrisJobke
    Contributor

    It is now a command: #15437

    @PVince81 Should we move this to a repair step?

  15. self-assigned this
    on Apr 9, 2015
  16. PVince81 commented on Apr 10, 2015

    @PVince81
    ContributorAuthor

    Hmm maybe if we consider that the upgrade time is the best time to do a bit of cleanup.

  17. MorrisJobke commented on Apr 10, 2015

    @MorrisJobke
    Contributor

    Hmm maybe if we consider that the upgrade time is the best time to do a bit of cleanup.

    I don't think so, because this step could take very long and simply would longer the maintenance for no actual reason. This cleanup can be done while running the instance in normal mode with no impact (except the load impact on the database for doing the query)

  18. MorrisJobke commented on Apr 10, 2015

    @MorrisJobke
    Contributor

    I would leave this as it is now.

  19. removed their assignment
    on Oct 5, 2015
  20. locked as resolved and limited conversation to collaborators on Aug 8, 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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions