这是indexloc提供的服务,不要输入任何密码
Skip to content

Orphaned objects present in the files table #678

@phette23

Description

@phette23

We have a small number of orphaned objects (location = -2) which have matching content hashes in the files table. The query I use to determine this is:

SELECT *
FROM mdl_files
WHERE contenthash IN (
  SELECT contenthash
  FROM mdl_tool_objectfs_objects
  WHERE location = -2);

Am I correct in my understanding that while the orphan_objects task marks files that have been deleted as orphaned (sets location = -2) there is no corresponding task which resets them to location = 2 if a file with a matching hash is later uploaded?

I'm not sure why this happens but one possibility: a file is deleted in Moodle, the orphan_objects task sets the associated object tuple to orphaned, but before the delete_orphaned_object_metadata task runs to remove the tuple (and potentially file depending on the deleteexternal setting) an identical file is uploaded.

Is there any harm in resetting tool_objectfs_objects.location to 2 if a file exists in the files table?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions