Skip to content
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

Objectstore multibucket #24760

Merged
merged 5 commits into from
May 24, 2016
Merged

Objectstore multibucket #24760

merged 5 commits into from
May 24, 2016

Conversation

rullzer
Copy link
Contributor

@rullzer rullzer commented May 22, 2016

PR to allow multiple buckets being used when objectstore is used as homestorage.

  1. A config section called 'objectstore_multibucket' is read in. Which has precedence over the normal objectstore config section.
  2. This multibucket objectstore should for now only be used with new installations (same restriction for now as the single bucket implementation).
  3. For now we only provide our own mapper from username => bucket. Which is MD5 the username and take the first 3 chars

Note that currently only the s3 homeobjectstore will use the mutlibuckets (we could extend swift but for now I would not do that as we have enough to tests with s3 already).

TODO:

  • Unit tests for ObjectHomeMountProvider

CC: @butonic @icewind1991 @PVince81 comments please.

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @icewind1991 to be a potential reviewer

@rullzer
Copy link
Contributor Author

rullzer commented May 23, 2016

Unit tests added

@@ -52,9 +52,27 @@ public function __construct(IConfig $config) {
* @return \OCP\Files\Mount\IMountPoint[]
*/
public function getHomeMountForUser(IUser $user, IStorageFactory $loader) {

$config = $this->multiBucketObjectStore($user);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getConfigForMultiBuckerObjectStore ? 😉
A method name that doesn't really say what the method does is a bit confusing

@PVince81
Copy link
Contributor

Please adjust "config.sample.php" for the new values.

I'm not 100% convinced about having a separate config section just for multi-bucket.
The way I understand it is that multi-bucket is basically the same as before but where the bucket name is dynamic. So extending the existing config would be simpler. @rullzer what do you think ?

@PVince81
Copy link
Contributor

Remember when we talked about it we said it would be good to be able to specify the Mapper class name. I see you haven't added the config option for that yet.

Maybe considering my comments above about the separate config, maybe we could replace the "bucket" argument in the settings with this:

"bucketMapper" => "OC\Files\ObjectStore\Mapper"

So if there is a "bucketMapper" arg, it has precedence over "bucket".

@rullzer
Copy link
Contributor Author

rullzer commented May 23, 2016

I did not yet edit the config.php since this does not work for the swift home storage atm.

I created a separate config as a future proof thingy. Since if we reuse the config there would be no proper way for us to migrate from single to multibucket.

@rullzer
Copy link
Contributor Author

rullzer commented May 23, 2016

Yes eventually we'd want the mapper to be specifiable. But for now I think 1 default is fine. We should first properly test this all before we do all the fancy stuff. Should be trivial to add btw.

@PVince81
Copy link
Contributor

Hmmm ok, then fine by me for now 👍

Would be good to know what @butonic @icewind1991 and @owncloud/qa think

@rullzer
Copy link
Contributor Author

rullzer commented May 23, 2016

Ah forgot to copy the commit that saves the user mapping to the db... will follow later this evening.

@rullzer
Copy link
Contributor Author

rullzer commented May 23, 2016

ok now we properly save the bucket in the preference table.
Unit tests updated and extended

#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####

ErrorDocument 403 /core/templates/403.php
ErrorDocument 404 /core/templates/404.php
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rullzer 🙀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah my bad... fixed

$mapper = new \OC\Files\ObjectStore\Mapper($user);
$config['arguments']['bucket'] .= $mapper->getBucket();

$this->config->setUserValue($user->getUID(), 'homeobjectstore', 'bucket', $config['arguments']['bucket']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, nice!

}
$config['arguments']['user'] = $user;

$bucket = $this->config->getUserValue($user->getUID(), 'homeobjectstore', 'bucket', null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For swift you would call this container. In ceph you might want to call it pool. We should stick to one terminology. I guess s3 is the most prominent, so bucket is fine. At least for our internal config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we have to use something... I really don't care what ;)

@PVince81
Copy link
Contributor

@rullzer @DeepDiver1975 @butonic so should we defer the whole thing for 9.2 to have a more rounded solution ? Or is there a benefit of having this merged first for 9.1 where some people could already setup their new systems to use multi-bucket ?

CC @cmonteroluque

@rullzer
Copy link
Contributor Author

rullzer commented May 24, 2016

I think moving it to 9.2 makes sense. To have things properly tested and reviewed.

@MTRichards
Copy link
Contributor

I think moving it to 9.2 makes sense. To have things properly tested and reviewed.

In general, I agree, but we do have a few who are expecting this feature in 9.1.

As I understand it, multibucket is ok, but one can't migrate into it, it will only work for all new installations. Is that correct?

Is there a logical path to migration from there, or would new installs be isolated and stuck in the future?

@rullzer
Copy link
Contributor Author

rullzer commented May 24, 2016

They can only be new installations. And then it should be the same.
And right now it only really works with S3..

@PVince81
Copy link
Contributor

Ok, then let's get this in in the current form.

Needs a second reviewer @butonic @DeepDiver1975 @icewind1991 @Xenopathic

@icewind1991
Copy link
Contributor

👍 I'm fine with this as an initial version

@PVince81 PVince81 merged commit e7110c7 into master May 24, 2016
@PVince81 PVince81 deleted the objectstore_multibucket branch May 24, 2016 13:16
@lock
Copy link

lock bot commented Aug 5, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants