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.
If my interpretation of the code in
BackgroundScanner
is correct,getNodeForFile()
relies on the existence of an existing mount to determine theNode
for a givenfileId
.Sometimes, this fails. Specifically, this line is returning an empty array.
$cachedMounts = $this->userMountCache->getMountsForFileId($fileId)
Tracking this further, I found that no corresponding mount can be found for some
fileId
that are present inoc_filecache
when joiningoc_mounts
throughoc_storage
.Why is this even a problem, other than creating many log entries?
If the number of such entries in
oc_filecache
is large then the entire batch contains non-scannable entries, starving the scanning of other entries inoc_filecache
that have a corresponding mount.My PR proposes to only process files whose
fileId
that can be related to an existing mount.More details:
I have a lot of entries in
oc_filecache
that look like this:These entries correctly relate to an entry in
oc_storages
:However, no mount can be found: