-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[DRAFT] rgw: Initial exploratory commit for multiple drivers #52665
base: main
Are you sure you want to change the base?
Conversation
osd 'allow rwx' \ | ||
mgr 'allow rw' \ | ||
>> "$keyring_fn" | ||
if [ "$CEPH_NUM_MON" -gt 0 ]; then |
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.
This conditional was necessary to run DBStore without a monitor via vstart. The changes in this file are not meant to be committed
src/rgw/driver/rados/rgw_zone.cc
Outdated
@@ -1114,6 +1114,11 @@ static int read_or_create_default_zone(const DoutPrefixProvider* dpp, | |||
return r; | |||
} | |||
} | |||
r = info.sal_config.set("type", "rados"); |
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.
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.
My thought is this, and I don't know how hard it is:
The ceph.conf chooses a config provider. If this is not given, it should default to the RADOS config provider.
Each config provider has a default json if none is stored. It should probably be the correct store for that provider (so the RADOS provider will default to radosstore, the DB provider should default to DBStore, the json file provider should default to POSIXStore). If invalid json exists, it should error out.
What do people think about this?
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.
@dang agreed. when a ConfigStore
backend's create_zone()
function is called with an empty sal_config
, it should initialize that for the same kind of store. read_or_create_default_zone()
is generic to all ConfigStore
s, so the default logic doesn't belong here
bool use_gc, optional_yield y) { | ||
|
||
driver = newRadosStore(); | ||
RGWRados* rados = static_cast<rgw::sal::RadosStore* >(driver)->getRados(); |
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.
@dang is all of this RadosStore specific initialization supposed to happen right after the driver gets set to a RadosStore? Instead of just passing a dpp, sal_config, and driver to the new functions, I had to also add the other 10 arguments to init_storage_provider()
for the time being. Should these be passed into the RadosStores json config? Or is there some other way that you had in mind?
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.
In principle, I suppose, all this can apply to any store, but the way it's supposed to work is that you have a Factory, and you pass the json into the Factory, and it picks the correct factory instance, which understands all the config in that json. So you shouldn't need all these config to be passed in, it will live either in the json, or in the ceph.conf (for the RADOS store specific stuff).
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.
most of these bool options come from ceph.conf, so can be overridden per-radosgw instance. anything we put in the zone json must apply to all radosgw[-admin]s in the zone
361700e
to
4f94723
Compare
@cbodley: In case you want to play around with this, the simplest workflow using vstart.sh looks like this:
For reasons I'd like to discuss in further detail, hard coding a |
@@ -122,6 +122,7 @@ struct RGWZoneParams : RGWSystemMetaObj { | |||
std::string realm_id; | |||
|
|||
JSONFormattable tier_config; | |||
JSONFormattable sal_config; |
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.
@dang I ended up choosing sal_config
for the name of the json that will be part of the zone's info. Do you have another suggestion for the name? driver_config
?
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 think sal_config is fine. It's more than drivers (filters too), so SAL is probably appropriate.
src/rgw/driver/rados/rgw_zone.cc
Outdated
@@ -1114,6 +1114,11 @@ static int read_or_create_default_zone(const DoutPrefixProvider* dpp, | |||
return r; | |||
} | |||
} | |||
r = info.sal_config.set("type", "rados"); |
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.
My thought is this, and I don't know how hard it is:
The ceph.conf chooses a config provider. If this is not given, it should default to the RADOS config provider.
Each config provider has a default json if none is stored. It should probably be the correct store for that provider (so the RADOS provider will default to radosstore, the DB provider should default to DBStore, the json file provider should default to POSIXStore). If invalid json exists, it should error out.
What do people think about this?
@@ -122,6 +122,7 @@ struct RGWZoneParams : RGWSystemMetaObj { | |||
std::string realm_id; | |||
|
|||
JSONFormattable tier_config; | |||
JSONFormattable sal_config; |
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 think sal_config is fine. It's more than drivers (filters too), so SAL is probably appropriate.
src/rgw/rgw_admin.cc
Outdated
@@ -4238,6 +4242,8 @@ int main(int argc, const char **argv) | |||
cerr << "couldn't init config storage provider" << std::endl; | |||
return EIO; | |||
} | |||
JSONFormattable sal_config; | |||
sal_config.set("type", "rados"); |
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.
This isn't going to work, unless it's just a placeholder for now. Currently, radosgw-admin get's it's config from ceph.conf, and will use the correct store. This allows you to create users for DBStore, for example. So going forward, radosgw-admin needs to load the json like the main RGW does, and use the correct store.
bool use_gc, optional_yield y) { | ||
|
||
driver = newRadosStore(); | ||
RGWRados* rados = static_cast<rgw::sal::RadosStore* >(driver)->getRados(); |
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.
In principle, I suppose, all this can apply to any store, but the way it's supposed to work is that you have a Factory, and you pass the json into the Factory, and it picks the correct factory instance, which understands all the config in that json. So you shouldn't need all these config to be passed in, it will live either in the json, or in the ceph.conf (for the RADOS store specific stuff).
Signed-off-by: Ali Maredia <amaredia@redhat.com>
build is working but not tested yet Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
4f94723
to
e06667f
Compare
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
unstale |
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
unstale |
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test dashboard cephadm
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox
jenkins test windows