-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[stable9] Filecache repair step #29491
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
Conversation
Whenever a parent-child relationship describes a specific path but the entry's actual path is different, this new repair step will adjust it. In the event where another entry already exists under that name, the latter is deleted and replaced by the above entry. This should help preserve the metadata associated with the original entry.
When fixing failed cross-storage moves in the file cache and using the storage id filter, we filter by target storage for phase 1. However, we also need to fix the source storages in phase 2. To do so, a list of affected source storages is now gathered in phase 1 to be run on phase 2.
This instead of iterating over all storages which is way less efficient due to the 1-N nature of potential failed cross-storage moves that we are repairing. If singleuser mode is enabled and "--all --repair" is passed, all storages will be repaired in bulk (no repair filter). If not, it will fall back to iterating over each storage which is slower.
|
All green. But would be good to address my comments from the original PR: #29045 (review) |
| private function countResultsToProcessParentIdWrongPath($storageNumericId = null) { | ||
| $qb = $this->connection->getQueryBuilder(); | ||
| $qb->select($qb->createFunction('COUNT(*)')); | ||
| $this->addQueryConditionsParentIdWrongPath($qb, $storageNumericId); |
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.
@PVince81 can you check this - PHPStorm shows that this second param is not used in the method 👀
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.
ohh... some old code it seems. In the past we passed around the storage numeric id, but for this one method it just uses the local attribute now.
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.
nothing to worry about: the $this->storageNumericId is also passed from the outside for some methods, while other methods use the attribute directly... a bit messy, yes
| ->where($qb->expr()->eq('fileid', $qb->createNamedParameter($fileId))); | ||
| $qb->execute(); | ||
|
|
||
| $text = "Fixed file cache entry with fileid $fileId, set wrong path \"$wrongPath\" to \"$correctPath\""; |
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.
unused code
|
|
||
| $storageIds = []; | ||
| foreach ($rows as $row) { | ||
| $storageIds[] = $row['storage']; |
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.
you killed too much, the upgrade is not reporting any more.
We need to emit an event on $this object as it's a BasicEmmiter, it will output the entry on the console
|
|
Fixed the issues and worked. |
|
@tomneedham quick review ? 002417a |
|
Nice - and we keep some output :) 👍 |
|
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. |
Re-re-send of #29489 for CI
@tomneedham