Fix metadata storage with sharding#48563
Merged
icewind1991 merged 2 commits intomasterfrom Nov 7, 2024
Merged
Conversation
artonge
reviewed
Oct 3, 2024
| ): IFilesMetadata { | ||
| $storageId = $node->getStorage()->getCache()->getNumericStorageId(); | ||
| try { | ||
| /** @var FilesMetadata $metadata */ |
Member
Author
There was a problem hiding this comment.
Things are typed to return this interface, but only the implementation has the setStorageId method because I didn't want to touch the public api
artonge
reviewed
Oct 3, 2024
artonge
reviewed
Oct 3, 2024
artonge
reviewed
Oct 3, 2024
Comment on lines
+35
to
+39
| // all code paths that lead to saving metadata *should* have the storage id set | ||
| // this fallback is there just in case |
Contributor
There was a problem hiding this comment.
We'll need to update applications like Photos
artonge
reviewed
Oct 3, 2024
| $query->select('storage') | ||
| ->from('filecache') | ||
| ->where($query->expr()->eq('fileid', $query->createNamedParameter($filesMetadata->getFileId(), IQueryBuilder::PARAM_INT))); | ||
| return $query->executeQuery()->fetchColumn(); |
Contributor
There was a problem hiding this comment.
Wondering if we should cache it with $filesMetadata->setStorageId(), but I don't think that we have scenarios where we are saving the same metadata object multiple times.
Member
Author
There was a problem hiding this comment.
Seems unlikely yes, but might as well
241c22d to
46a889c
Compare
46a889c to
b238fc9
Compare
3 tasks
provokateurin
approved these changes
Nov 4, 2024
Member
provokateurin
left a comment
There was a problem hiding this comment.
LGTM, just psalm is unhappy.
artonge
approved these changes
Nov 5, 2024
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
b238fc9 to
b21c026
Compare
Member
Author
|
/backport to stable30 |
2 tasks
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
And add the most minimal set of tests to ensure this keeps working.
The way of passing the storage id to the db code is a bit iffy. But I didn't want to change any public interface