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

[DRAFT] rgw: Initial exploratory commit for multiple drivers #52665

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

alimaredia
Copy link
Contributor

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
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

@alimaredia alimaredia requested a review from a team as a code owner July 27, 2023 04:16
@github-actions github-actions bot added the rgw label Jul 27, 2023
osd 'allow rwx' \
mgr 'allow rw' \
>> "$keyring_fn"
if [ "$CEPH_NUM_MON" -gt 0 ]; then
Copy link
Contributor Author

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

@@ -1114,6 +1114,11 @@ static int read_or_create_default_zone(const DoutPrefixProvider* dpp,
return r;
}
}
r = info.sal_config.set("type", "rados");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cbodley @dang when/where is it that you envisioned the default backend to be rados? Is it in the scenario that no json config is provided or if that json is missing a store? I put this here as a place holder for that discussion.

Copy link
Contributor

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?

Copy link
Contributor

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 ConfigStores, 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();
Copy link
Contributor Author

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?

Copy link
Contributor

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).

Copy link
Contributor

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

@alimaredia
Copy link
Contributor Author

@cbodley: In case you want to play around with this, the simplest workflow using vstart.sh looks like this:

ninja vstart && MON=1 OSD=1 MDS=0 RGW=1 MGR=0 ../src/vstart.sh -n -d
./bin/radosgw-admin -c ceph.conf zone get --rgw-zone=default > infile.json
jq '. |= .+ { "sal_config" : { "type" : "base", "next" : { "type" : "rados" } } }' infile.json > infile_full_sal_config.json
./bin/radosgw-admin -c ceph.conf zone set --rgw-zone=default --infile=infile_full_sal_config.json
kill $(cat out/radosgw.8000.pid)
sleep 2
./bin/radosgw -c ceph.conf --log-file=out/radosgw.8000.log --admin-socket=out/radosgw.8000.asok --pid-file=out/radosgw.8000.pid --rgw_luarocks_location=out/luarocks --debug-rgw=20 --debug-ms=1 -n client.rgw.8000 --rgw_frontends='beast port=8000'

For reasons I'd like to discuss in further detail, hard coding a sal_config when the default zone is created (as seen in driver/rados/rgw_zone.cc) was not working because the RGWZoneInfo's sal_config was cleared out.

@@ -122,6 +122,7 @@ struct RGWZoneParams : RGWSystemMetaObj {
std::string realm_id;

JSONFormattable tier_config;
JSONFormattable sal_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.

@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?

Copy link
Contributor

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.

@@ -1114,6 +1114,11 @@ static int read_or_create_default_zone(const DoutPrefixProvider* dpp,
return r;
}
}
r = info.sal_config.set("type", "rados");
Copy link
Contributor

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;
Copy link
Contributor

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.

@@ -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");
Copy link
Contributor

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();
Copy link
Contributor

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>
Copy link

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.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Jan 15, 2024
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

Copy link

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.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Mar 26, 2024
@alimaredia
Copy link
Contributor Author

unstale

@github-actions github-actions bot removed the stale label Mar 26, 2024
Copy link

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.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label May 25, 2024
@dang
Copy link
Contributor

dang commented May 28, 2024

unstale

@github-actions github-actions bot removed the stale label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants