Skip to content

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.

'message' => 'Could not get object ' . $urn . ' for file ' . $path,
]);
$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
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
@skjnldsv skjnldsv added the 2. developing Work in progress label Feb 21, 2024
This was referenced Mar 12, 2024
@Altahrim Altahrim mentioned this pull request Mar 20, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 14, 2024
@blizzz blizzz modified the milestones: Nextcloud 31, Nextcloud 32 Jan 29, 2025
@sorbaugh
Copy link
Contributor

sorbaugh commented Aug 4, 2025

Aligned with @icewind1991 . We should revive this but it's being debated if there can be an improvement made on how to track which files are deleted to give admins the chance to review these.

@icewind1991 icewind1991 force-pushed the obj-delete-not-found branch from a9c882d to cf24bd6 Compare August 4, 2025 14:46
@icewind1991 icewind1991 force-pushed the obj-delete-not-found branch from cf24bd6 to 534c4d4 Compare August 4, 2025 14:49
@skjnldsv skjnldsv removed this from the Nextcloud 32 milestone Sep 28, 2025
@skjnldsv skjnldsv added this to the Nextcloud 33 milestone Sep 28, 2025
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.

6 participants