-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
allow configuring multiple object store backends #52786
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
cf36e0c to
95a019a
Compare
95a019a to
5c33aec
Compare
b2923b0 to
77b1e72
Compare
16533d5 to
077003d
Compare
14b8f17 to
2acc97c
Compare
6440956 to
4a27074
Compare
| $query = $this->connection->getQueryBuilder(); | ||
| $query->update('preferences') | ||
| ->set('configvalue', $query->createNamedParameter($target)) | ||
| ->where($query->expr()->eq('appid', $query->createNamedParameter('homeobjectstore'))) |
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.
That’s not an appid
What about using core?
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.
Having a separate "scope" makes it much easier to work with the values in bulk (see for example the query in the rename command).
Fwiw: homeobjectstore is already used as an appid for storing the bucket for the user.
53b0d3b to
404bce1
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.
I'm not familiar with the object store, but the logic here makes sense in accordance to the PR's description.
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
404bce1 to
4990d75
Compare
Allow configuring multiple object store backends to allow further load balancing and easier migration.
Configuration
Multiple object stores are configured by setting the
objectstoresystem config to an array of object storage configurations instead of a single configuration. This array can contains both configuration items and references to other configuration keys (which functions as an alias).When a the configured bucket for a user is an alias, the target of the alias is stored as the users chosen configuration instead to make migrations easier.
The "default" option is required to be an alias to prevent instances from accidentally being setup in a way that makes migration difficult.
By default everything is put in the "default" bucket, objects for the root storage are put in the "root" bucket if it exists ("default" if it doesn't), the backend for users can be set with a user preference option (
occ user:setting <user> homeobjectstore objectstore <config key>).Existing
objectstoreandobjectstore_multibucketconfigurations are handled transparently.Migration example
Migrating users to a new s3 server could be done with the following steps:
defaultreference to the new configuration.all new users will now be stored on the new s3 server, existing users can now be migrated one-by-one with minimal downtime
example configuration:
For a use case where all objects in the root storage is put in "objectstore1/nextcloud-root", users created before the objectstore migration have the "homeobjectstore.objectstore" config option set to "old" and have their objects stored in "objectstore1/nextcloud" which all users created afterwards have their objects stored in the "objectstore2/nextcloud-XX" buckets.
todo