Skip to content

Repair filecache parents + path_hash #22866

Closed

Description

@PVince81

In some situations like #22824, one might need to manually operate on the filecache to restore broken entries.

The trouble with this is that when reparenting entries, one would need to update both the "parent" value and "path_hash", which can be tedious.

Also, there might be instances where bugs caused holes in the file cache or inconsistencies.

I suggest we add a OCC repair command to repair these:

  • repair "path_hash" column, if different
  • repair "parent" column, if it doesn't match

Could be part of the health check: #18922
Could also be made an extra --repair option for occ files:scan, if the logic is close enough to be suitable. (I suppose one could call this some kind of "scandisk" 😉)

@icewind1991 @MorrisJobke @butonic

Activity

  1. added this to the backlog milestone on Mar 4, 2016
  2. MorrisJobke commented on Mar 4, 2016

    @MorrisJobke
    Contributor

    Could be part of the health check: #18922

    I already have SQL statements here - but they are kind of expensive and needs some re-evaluation.

  3. PVince81 commented on Oct 12, 2016

    @PVince81
    ContributorAuthor

    Here are some Mysql specific ones I made quickly:

    • path hash check: select * from oc_filecache where path_hash != md5(path); => must return 0 results
    • parent-child relationship check: select fc.fileid, fc.path, fc2.fileid, fc2.path from oc_filecache fc, oc_filecache fc2 where fc.parent = fc2.fileid and CONCAT(fc2.path, '/', fc.name) != fc.path and fc2.path != ''; => must return 0 results
  4. PVince81 commented on Feb 23, 2017

    @PVince81
    ContributorAuthor
    • orphaned parents: select * from oc_filecache f where f.parent > 0 and not exists (select fileid from oc_filecache f2 where f.parent=f2.fileid);
  5. PVince81 commented on Jun 26, 2017

    @PVince81
    ContributorAuthor

    for cases where parent-child don't match path, fix the path: #28217

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions