From: Abhishek Lekshmanan Date: Thu, 1 Oct 2020 08:59:08 +0000 (+0200) Subject: svc: introduce role_rados service X-Git-Tag: v18.0.0~710^2~42 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3c7d027322c870a8d46c58010baf8d5d2c5eb8b5;p=ceph-ci.git svc: introduce role_rados service Signed-off-by: Abhishek Lekshmanan --- diff --git a/src/rgw/rgw_service.cc b/src/rgw/rgw_service.cc index 874c2e3e3b3..aacdf35646d 100644 --- a/src/rgw/rgw_service.cc +++ b/src/rgw/rgw_service.cc @@ -26,6 +26,7 @@ #include "services/svc_sys_obj_cache.h" #include "services/svc_sys_obj_core.h" #include "services/svc_user_rados.h" +#include "services/svc_role_rados.h" #include "common/errno.h" @@ -34,6 +35,7 @@ #include "rgw_metadata.h" #include "rgw_otp.h" #include "rgw_user.h" +#include "rgw_role.h" #define dout_subsys ceph_subsys_rgw @@ -74,6 +76,7 @@ int RGWServices_Def::init(CephContext *cct, sysobj = std::make_unique(cct); sysobj_core = std::make_unique(cct); user_rados = std::make_unique(cct); + role_rados = std::make_unique(cct); if (have_cache) { sysobj_cache = std::make_unique(dpp, cct); @@ -113,6 +116,7 @@ int RGWServices_Def::init(CephContext *cct, } user_rados->init(rados.get(), zone.get(), sysobj.get(), sysobj_cache.get(), meta.get(), meta_be_sobj.get(), sync_modules.get()); + role_rados->init(zone.get(), meta.get(), meta_be_sobj.get(), sysobj.get()); can_shutdown = true; @@ -244,6 +248,12 @@ int RGWServices_Def::init(CephContext *cct, ldpp_dout(dpp, 0) << "ERROR: failed to start otp service (" << cpp_strerror(-r) << dendl; return r; } + + r = role_rados->start(y, dpp); + if (r < 0) { + ldout(cct, 0) << "ERROR: failed to start role_rados service (" << cpp_strerror(-r) << dendl; + return r; + } } /* cache or core services will be started by sysobj */ @@ -313,6 +323,7 @@ int RGWServices::do_init(CephContext *_cct, bool have_cache, bool raw, bool run_ cache = _svc.sysobj_cache.get(); core = _svc.sysobj_core.get(); user = _svc.user_rados.get(); + role = _svc.role_rados.get(); return 0; } diff --git a/src/rgw/rgw_service.h b/src/rgw/rgw_service.h index b94f4cb28c0..064f541ea53 100644 --- a/src/rgw/rgw_service.h +++ b/src/rgw/rgw_service.h @@ -65,6 +65,8 @@ class RGWSI_MetaBackend_OTP; class RGWSI_Notify; class RGWSI_OTP; class RGWSI_RADOS; +class RGWSI_Role; +class RGWSI_Role_RADOS; class RGWSI_Zone; class RGWSI_ZoneUtils; class RGWSI_Quota; @@ -104,6 +106,7 @@ struct RGWServices_Def std::unique_ptr sysobj_cache; std::unique_ptr user_rados; std::unique_ptr datalog_rados; + std::unique_ptr role_rados; RGWServices_Def(); ~RGWServices_Def(); @@ -146,6 +149,7 @@ struct RGWServices RGWSI_SysObj_Cache *cache{nullptr}; RGWSI_SysObj_Core *core{nullptr}; RGWSI_User *user{nullptr}; + RGWSI_Role *role{nullptr}; int do_init(CephContext *cct, bool have_cache, bool raw_storage, bool run_sync, optional_yield y, const DoutPrefixProvider *dpp); @@ -166,6 +170,7 @@ class RGWMetadataHandler; class RGWUserCtl; class RGWBucketCtl; class RGWOTPCtl; +class RGWRoleCtl; struct RGWCtlDef { struct _meta { @@ -174,6 +179,7 @@ struct RGWCtlDef { std::unique_ptr bucket_instance; std::unique_ptr user; std::unique_ptr otp; + std::unique_ptr role; _meta(); ~_meta(); @@ -182,6 +188,7 @@ struct RGWCtlDef { std::unique_ptr user; std::unique_ptr bucket; std::unique_ptr otp; + std::unique_ptr role; RGWCtlDef(); ~RGWCtlDef(); @@ -202,11 +209,13 @@ struct RGWCtl { RGWMetadataHandler *bucket_instance{nullptr}; RGWMetadataHandler *user{nullptr}; RGWMetadataHandler *otp{nullptr}; + RGWMetadataHandler *role{nullptr}; } meta; RGWUserCtl *user{nullptr}; RGWBucketCtl *bucket{nullptr}; RGWOTPCtl *otp{nullptr}; + RGWRoleCtl *role{nullptr}; int init(RGWServices *_svc, const DoutPrefixProvider *dpp); };