fix(files_external): clean up filecache when deleting an external storage - #64173
Open
solracsf wants to merge 1 commit into
Open
fix(files_external): clean up filecache when deleting an external storage#64173solracsf wants to merge 1 commit into
solracsf wants to merge 1 commit into
Conversation
…rage StoragesService::removeStorage() dispatched StorageDeletedEvent before Storage::cleanByMountId(). MountCacheService handles that event by removing the storage's oc_mounts rows, and cleanByMountId() looks the storages up through those rows, so it found nothing and left the oc_filecache and oc_storages rows behind. occ files:cleanup cannot recover them because the oc_storages row still exists. Dispatch the event after the cleanup, which restores the order used before the event was introduced. Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
solracsf
requested review from
Altahrim,
come-nc,
icewind1991 and
salmart-dev
and removed request for
a team
September 10, 2026 10:13
Member
Author
|
/backport to stable35 |
Member
Author
|
/backport to stable34 |
Member
Author
|
/backport to stable33 |
CarlSchwan
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #7312. This fixes the part where removed external storages leave their filecache rows behind, not the table fragmentation discussed there.
Since 33.0.0 (c80c980),
StorageDeletedEventis dispatched beforeStorage::cleanByMountId().MountCacheServicereacts to it by deleting the storage'soc_mountsrows, which are exactly whatcleanByMountId()uses to find the storages, so theoc_filecacheandoc_storagesrows stay.occ files:cleanupdoesn't pick them up either, because the storage row still exists.The event now fires after the cleanup, so its listeners no longer see the deleted storage's cache and storage rows. In server only
MountCacheServicelistens, and it doesn't need them.Rows that were already orphaned on 33 and 34 are not cleaned up by this change. stable33 and stable34 are affected; stable32 doesn't have the event.