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)
* 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:
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):
* 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):
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.
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" /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) /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:/
https:/
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 nullptr} ; /* internal zone params, e.g., rados pools */
RGWZoneParams *zone_params{
https:/ /github. com/ceph/ ceph/blob/ v16.0.0/ src/rgw/ services/ svc_zone. cc#L135- L138 >rgw_zone. empty() ) { params- >set_name( default_ zone_name) ;
if (creating_defaults && cct->_conf-
ldout(cct, 10) << " Using default name "<< default_zone_name << dendl;
zone_
}
* Will create a log pool https:/ /github. com/ceph/ ceph/blob/ v16.0.0/ src/rgw/ rgw_log. cc#L452 /github. com/ceph/ ceph/blob/ v16.0.0/ src/rgw/ rgw_zone. cc#L752- L762
* Will create a control pool https:/
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.control
<rgw_zone>.rgw.log
<rgw_zone>
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" /github. com/openstack/ charm-ceph- radosgw/ blob/0f51adbba0 96c054979349ae8 6adfd2ce602bf87 /hooks/ hooks.py# L249-L250
https:/
* 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/0f51adbba0 96c054979349ae8 6adfd2ce602bf87 /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; /paste. ubuntu. com/p/rCQ3x6xhS b/ https:/ /paste. ubuntu. com/p/Z4DKtZ3M8 s/
* 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:/
* set the "zone" config to have the value of "default" by default.