Skip to content

delete filecache entries when the object doesn't exist #40522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

icewind1991
Copy link
Member

If the cache and object store get out of sync for any reason we can have items in the cache for an object store with no matching objects. This changes it so the cache item is deleted automatically when such a file is being read.

It logs the full cache item to provide some breadcrumbs if these files ever need to be recovered.
I would like to have a more complete "trashbin" for these items to help with debugging/resolving the cache desync issues but I can't think of anything atm.

]);
$this->logger->warning("removing filecache entry for object that doesn't seem to exist on the object store. " . json_encode($stat));
$this->getCache()->remove((int)$stat['fileid']);

Check failure

Code scanning / Psalm

InvalidArgument

Argument 1 of OC\Files\Cache\Cache::remove expects string, but int provided
@solracsf solracsf added this to the Nextcloud 28 milestone Oct 27, 2023
@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
This was referenced Nov 6, 2023
This was referenced Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants