-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
Fix metadata storage with sharding #48563
Conversation
try { | ||
/** @var FilesMetadata $metadata */ |
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.
Typing is not working?
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.
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
// all code paths that lead to saving metadata *should* have the storage id set | ||
// this fallback is there just in case |
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.
We'll need to update applications like Photos
$query->select('storage') | ||
->from('filecache') | ||
->where($query->expr()->eq('fileid', $query->createNamedParameter($filesMetadata->getFileId(), IQueryBuilder::PARAM_INT))); | ||
return $query->executeQuery()->fetchColumn(); |
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.
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.
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.
Seems unlikely yes, but might as well
241c22d
to
46a889c
Compare
46a889c
to
b238fc9
Compare
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.
LGTM, just psalm is unhappy.
Signed-off-by: Robin Appelman <[email protected]>
Signed-off-by: Robin Appelman <[email protected]>
b238fc9
to
b21c026
Compare
/backport to stable30 |
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