From: Ali Masarwa Date: Sun, 20 Apr 2025 07:21:24 +0000 (+0300) Subject: RGW/standalone: fixed teuthology issues X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=263264ae76f83f7d03f6b7e32eda58aa0676a604;p=ceph.git RGW/standalone: fixed teuthology issues Signed-off-by: Ali Masarwa --- diff --git a/src/rgw/driver/rados/rgw_service.cc b/src/rgw/driver/rados/rgw_service.cc index bc3e92c7e6bc5..b1c9a40bf0e13 100644 --- a/src/rgw/driver/rados/rgw_service.cc +++ b/src/rgw/driver/rados/rgw_service.cc @@ -54,7 +54,8 @@ int RGWServices_Def::init(CephContext *cct, bool background_tasks, optional_yield y, const DoutPrefixProvider *dpp, - rgw::sal::ConfigStore* cfgstore) + rgw::sal::ConfigStore* cfgstore, + const rgw::SiteConfig* site) { finisher = std::make_unique(cct); bucket_sobj = std::make_unique(cct); @@ -66,7 +67,7 @@ int RGWServices_Def::init(CephContext *cct, datalog_rados = std::make_unique(cct); mdlog = std::make_unique(cct, run_sync, cfgstore); notify = std::make_unique(cct); - zone = std::make_unique(cct, cfgstore); + zone = std::make_unique(cct, cfgstore, site); zone_utils = std::make_unique(cct); quota = std::make_unique(cct); sync_modules = std::make_unique(cct); @@ -268,7 +269,7 @@ int RGWServices::do_init(CephContext *_cct, rgw::sal::RadosStore* driver, bool h cct = _cct; site = &_site; - int r = _svc.init(cct, driver, have_cache, raw, run_sync, background_tasks, y, dpp, cfgstore); + int r = _svc.init(cct, driver, have_cache, raw, run_sync, background_tasks, y, dpp, cfgstore, site); if (r < 0) { return r; } diff --git a/src/rgw/driver/rados/rgw_service.h b/src/rgw/driver/rados/rgw_service.h index f0c9f6cfe4b93..e4d3df4f91105 100644 --- a/src/rgw/driver/rados/rgw_service.h +++ b/src/rgw/driver/rados/rgw_service.h @@ -11,8 +11,11 @@ #include "rgw_common.h" -namespace rgw::sal { -class RadosStore; +namespace rgw { + class SiteConfig; + namespace sal { + class RadosStore; + } } struct RGWServices_Def; @@ -106,7 +109,7 @@ struct RGWServices_Def int init(CephContext *cct, rgw::sal::RadosStore* store, bool have_cache, bool raw_storage, bool run_sync, bool background_tasks, - optional_yield y, const DoutPrefixProvider *dpp, rgw::sal::ConfigStore* cfgstore); + optional_yield y, const DoutPrefixProvider *dpp, rgw::sal::ConfigStore* cfgstore, const rgw::SiteConfig* site); void shutdown(); }; diff --git a/src/rgw/services/svc_zone.cc b/src/rgw/services/svc_zone.cc index 3303a38aef30e..056309f0bc2f1 100644 --- a/src/rgw/services/svc_zone.cc +++ b/src/rgw/services/svc_zone.cc @@ -20,7 +20,8 @@ using namespace std; using namespace rgw_zone_defaults; -RGWSI_Zone::RGWSI_Zone(CephContext *cct, rgw::sal::ConfigStore* _cfgstore) : RGWServiceInstance(cct), cfgstore(_cfgstore) +RGWSI_Zone::RGWSI_Zone(CephContext *cct, rgw::sal::ConfigStore* _cfgstore, const rgw::SiteConfig* _site) + : RGWServiceInstance(cct), cfgstore(_cfgstore), site(_site) { } @@ -137,26 +138,18 @@ int RGWSI_Zone::do_start(optional_yield y, const DoutPrefixProvider *dpp) assert(sysobj_svc->is_started()); /* if not then there's ordering issue */ - ret = rgw::read_realm(dpp, y, cfgstore, realm->get_id(), realm->get_name(), *realm); - if (ret < 0 && ret != -ENOENT) { - ldpp_dout(dpp, 0) << "failed reading realm info: ret "<< ret << " " << cpp_strerror(-ret) << dendl; - return ret; + if (site->get_realm().has_value()) { + *realm = site->get_realm().value(); } ldpp_dout(dpp, 20) << "realm " << realm->get_name() << " " << realm->get_id() << dendl; - current_period->set_realm_id(realm->get_id()); - ret = cfgstore->read_period(dpp, y, current_period->get_id(), current_period->epoch, *current_period); - if (ret < 0 && ret != -ENOENT) { - ldpp_dout(dpp, 0) << "failed reading current period info: " << " " << cpp_strerror(-ret) << dendl; - return ret; + if (site->get_period().has_value()) { + *current_period = site->get_period().value(); } + current_period->set_realm_id(realm->get_id()); - ret = cfgstore->read_default_zone(dpp, y, realm->get_id(), *zone_params, nullptr); - bool found_zone = (ret == 0); - if (ret < 0 && ret != -ENOENT) { - lderr(cct) << "failed reading zone info: ret "<< ret << " " << cpp_strerror(-ret) << dendl; - return ret; - } + *zone_params = site->get_zone_params(); + bool found_zone = true; cur_zone_id = rgw_zone_id(zone_params->get_id()); diff --git a/src/rgw/services/svc_zone.h b/src/rgw/services/svc_zone.h index 20e357919c498..0b793d670c54e 100644 --- a/src/rgw/services/svc_zone.h +++ b/src/rgw/services/svc_zone.h @@ -56,6 +56,7 @@ class RGWSI_Zone : public RGWServiceInstance std::unique_ptr sync_policy; rgw::sal::ConfigStore *cfgstore{nullptr}; + const rgw::SiteConfig* site{nullptr}; void init(RGWSI_SysObj *_sysobj_svc, librados::Rados* rados_, @@ -79,7 +80,7 @@ class RGWSI_Zone : public RGWServiceInstance rgw::sal::ConfigStore* cfgstore, optional_yield y); public: - RGWSI_Zone(CephContext *cct, rgw::sal::ConfigStore* cfgstore); + RGWSI_Zone(CephContext *cct, rgw::sal::ConfigStore* cfgstore, const rgw::SiteConfig* _site); ~RGWSI_Zone(); const RGWZoneParams& get_zone_params() const;