-
Notifications
You must be signed in to change notification settings - Fork 77
Description
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?