-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Keep fileId for deleted Items in a separate cache #31093
Conversation
Codecov Report
@@ Coverage Diff @@
## master #31093 +/- ##
============================================
+ Coverage 62.6% 62.6% +<.01%
- Complexity 18253 18263 +10
============================================
Files 1145 1146 +1
Lines 68566 68581 +15
Branches 1234 1234
============================================
+ Hits 42925 42938 +13
- Misses 25280 25282 +2
Partials 361 361
Continue to review full report at Codecov.
|
44b6079
to
322d733
Compare
/** | ||
* @var int[] | ||
*/ | ||
protected $deletedItems = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a CappedCache to avoid overflows ? in case of overflow we'd then still see the warnings that this PR is protecting against.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it holds just path=>id
info that is not stored into DB. For 32bit PHP any string could be up to 2Gb in length,while 64 bit has no limit on the string length.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant CappedCache to avoid having too many items inside this array.
Good that you also checked about string overflow
This approach reminds me of what we do with trashbin where we take note of information before a delete and use it after, so it matches an existing pattern. I think it's a good idea. @VicDeo would be good to know if we have any Webdav route that would cause this cache to contain lots of entries. As far as I understand we'd usually only have one entry as DELETE only applies to one item. But maybe if you delete a parent node this would contain all children ? |
can't say that for sure, need to check. Regarding coverage: my local tests include the part of the trait that is claimed to be uncovered by codecov. Do I need to refactor the trait into a trivial C&P to convince codecov that real coverage is more than 45%? |
@PVince81 According to xdebug, DELETE invoked on parent doesn't propagate to children. |
I'd expect codecov to pick it up if the trait's code is running during your unit tests.
Good to know, so it is possible that your new array in the trait will only ever contain a single item. I'd still prefer if you'd use the |
77668b3
to
beb784d
Compare
|
@ownclouders rebase |
Hey! I'm GitMate.io! This pull request is being rebased automatically. Please DO NOT push while rebase is in progress or your changes would be lost permanently |
Automated rebase with GitMate.io was successful! 🎉 |
@PVince81 @DeepDiver1975 another review please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 looks great now
please backport |
Stable10: #31479 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #30762
Description
Store items as
path->id
before deletion and resolve path into fileId using this cache in FileCustomPropertiesBackend.Motivation and Context
node is already deleted and the tree cache is purged when the property storage backend is processing the
delete
callback so it is not possible to resolve the path into id usinggetNodeForPath
As soon as file custom properties are referenced by fileId it leads to orphaned properties and log entries like this when files/directories are deleted
How Has This Been Tested?
expected
No log entries
actual
Types of changes
Checklist: