[stable34] fix(filecache): announce every removed entry so metadata is cleaned up - #64497
backportbot[bot] wants to merge 4 commits into
Conversation
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
clear() no longer dispatches removal events for every entry of the storage. With admin_audit enabled that wrote one log line per file of a deleted user. It now removes the filecache_extended and file metadata rows batch by batch, before deleting the filecache rows themselves. Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
cleanByMountId() deleted the filecache rows of an unmounted storage but left their filecache_extended and file metadata rows behind. It now goes through Storage::removeFileCacheEntries(), the same path clear() uses. files:cleanup also removes filecache_extended, files_metadata and files_metadata_index rows whose file is no longer in the filecache, so rows orphaned before this fix are cleaned up too. Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
dc9cc79 to
6df9950
Compare
Oracle returns numeric columns as strings, so the fallback lookup in MetadataRequestService::getStorageId() passed a string to FilesMetadata::setStorageId(int) and failed with a TypeError. On master the cast arrived with fcc63b9, which was not backported. Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
|
A production data point from 34.0.2 (MariaDB, Redis file locking), in support of getting this into 34.x. 34.0.2 still ships the unfixed What happened. A folder subtree of about 462,000 cache entries had been removed from disk, and
The workaround. SIGKILL rolled both back cleanly. We then recreated the empty folder skeleton, let a recursive The metadata half, |
Backport of #63998
Warning, This backport's changes differ from the original and might be incomplete⚠️
Todo
Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.