Comment 4 for bug 1856106

Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

Looked at this in detail and I think there are a couple of things to look at here.

The Rados Gateway daemon itself has some initialization logic on first startup that depends on the value of the rgw_zone configuration option (which is affected by the "zone" config key on the charm).

* If a zone group is not yet initialized, it will attempt to use local configuration to initialize some state;
* It will unconditionally create a zone named "default" (even if rgw_zone is set in the config on startup)

https://github.com/ceph/ceph/blob/v16.0.0/src/rgw/rgw_zone.cc#L31 default_zone_name == "default"
https://github.com/ceph/ceph/blob/v16.0.0/src/rgw/rgw_zone.cc#L81-L103 (creates a RGWZoneParams and unconditionally passes "default" for the zone name, calls RGWZoneParams::create_default -> RGWZoneParams::create -> fix_pool_names)
https://github.com/ceph/ceph/blob/v16.0.0/src/rgw/rgw_zone.cc#L105-L106 (creates a default zone RGWZone instance and passed the "default" zone name into it)

https://github.com/ceph/ceph/blob/v16.0.0/src/rgw/rgw_zone.cc#L752-L762

* It will set the zone parameters for the internal zone service to use "default" for the zone name, unless a zone name is provided via a the "rgw_zone" config:

https://github.com/ceph/ceph/blob/v16.0.0/src/rgw/services/svc_zone.h#L39
  RGWZoneParams *zone_params{nullptr}; /* internal zone params, e.g., rados pools */

https://github.com/ceph/ceph/blob/v16.0.0/src/rgw/services/svc_zone.cc#L135-L138
  if (creating_defaults && cct->_conf->rgw_zone.empty()) {
    ldout(cct, 10) << " Using default name "<< default_zone_name << dendl;
    zone_params->set_name(default_zone_name);
  }

* Will create a log pool https://github.com/ceph/ceph/blob/v16.0.0/src/rgw/rgw_log.cc#L452
* Will create a control pool https://github.com/ceph/ceph/blob/v16.0.0/src/rgw/rgw_zone.cc#L752-L762

The control and log pools will have names like this:

1) if zone config on the charm is set (hence the rgw_zone config is set):
<rgw_zone>.rgw.log
<rgw_zone>.rgw.control

2) if zone config is not set and whether or not pool-prefix is set:
default.rgw.log
default.rgw.control

The "pool-prefix" variable is charm-specific and doesn't get propagated to the rados gateway config file (does not get used to populate the rgw_zone config option):

* "zone" config option has a priority over "pool-prefix"
https://github.com/openstack/charm-ceph-radosgw/blob/0f51adbba096c054979349ae86adfd2ce602bf87/hooks/hooks.py#L249-L250

* if neither is specified, "default" is used as a default pool prefix name for pool creation by the charm, otherwise it will either be set to "zone" (in priority) or "pool-prefix" (if "zone" is not set):

https://github.com/openstack/charm-ceph-radosgw/blob/0f51adbba096c054979349ae86adfd2ce602bf87/hooks/ceph_rgw.py#L114

-----

Also, for non-multi-site deployments the charm does not create a zone specified in the "zone" config. I think we need to fix this and do that if the "zone" config is set.

As a result, I think we need to:

* deprecate the pool-prefix config;
* create a zone with a name provided via the "zone" charm config. This might require some clever initialization logic since we cannot create a zone before the API is up while not doing so leads to some warnings and errors: https://paste.ubuntu.com/p/rCQ3x6xhSb/ https://paste.ubuntu.com/p/Z4DKtZ3M8s/

* set the "zone" config to have the value of "default" by default.