From: Daniel Gryniewicz Date: Wed, 17 Aug 2022 16:25:45 +0000 (-0400) Subject: RGW - Zipper - Remove a number of casts from rgw_admin X-Git-Tag: v18.0.0~132^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f8526840a032bd3d8c39afa14d2ce0c43966a1a1;p=ceph.git RGW - Zipper - Remove a number of casts from rgw_admin There are still a ton of casts to RadosStore in rgw_admin. Remove the easy ones. Many of the rest represent actual operations that are specific to RadosStore, and need to be split out. Signed-off-by: Daniel Gryniewicz --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 843c89053935..4702ee30f2f5 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -1188,7 +1188,7 @@ static void show_reshard_status( class StoreDestructor { rgw::sal::Store* store; public: - explicit StoreDestructor(rgw::sal::RadosStore* _s) : store(_s) {} + explicit StoreDestructor(rgw::sal::Store* _s) : store(_s) {} ~StoreDestructor() { StoreManager::close_storage(store); rgw_http_client_cleanup(); @@ -2100,12 +2100,12 @@ static int do_period_pull(RGWRESTConn *remote_conn, const string& url, return 0; } -static int read_current_period_id(rgw::sal::RadosStore* store, const std::string& realm_id, +static int read_current_period_id(rgw::sal::Store* store, const std::string& realm_id, const std::string& realm_name, std::string* period_id) { RGWRealm realm(realm_id, realm_name); - int ret = realm.init(dpp(), g_ceph_context, store->svc()->sysobj, null_yield); + int ret = realm.init(dpp(), g_ceph_context, static_cast(store)->svc()->sysobj, null_yield); if (ret < 0) { std::cerr << "failed to read realm: " << cpp_strerror(-ret) << std::endl; return ret; @@ -2492,9 +2492,9 @@ static void sync_status(Formatter *formatter) const rgw_zone_id& source_id = iter.first; string source_str = "source: "; string s = source_str + source_id.id; - RGWZone *sz; - if ((sz = static_cast(store)->svc()->zone->find_zone(source_id))) { - s += string(" (") + sz->name + ")"; + std::unique_ptr sz; + if (store->get_zone()->get_zonegroup().get_zone_by_id(source_id.id, &sz) == 0) { + s += string(" (") + sz->get_name() + ")"; } data_status.push_back(s); get_data_sync_status(source_id, data_status, source_str.size()); @@ -2674,16 +2674,14 @@ static void get_hint_entities(const std::set& zones, const std::set static rgw_zone_id resolve_zone_id(const string& s) { - rgw_zone_id result; - - RGWZone *zone; - if ((zone = static_cast(store)->svc()->zone->find_zone(s))) { + std::unique_ptr zone; + int ret = store->get_zone()->get_zonegroup().get_zone_by_id(s, &zone); + if (ret < 0) + ret = store->get_zone()->get_zonegroup().get_zone_by_name(s, &zone); + if (ret < 0) return rgw_zone_id(s); - } - if (static_cast(store)->svc()->zone->find_zone_id_by_name(s, &result)) { - return result; - } - return rgw_zone_id(s); + + return rgw_zone_id(zone->get_id()); } rgw_zone_id validate_zone_id(const rgw_zone_id& zone_id) @@ -2695,7 +2693,7 @@ static int sync_info(std::optional opt_target_zone, std::optionalget_zone()->get_id()); - auto zone_policy_handler = static_cast(store)->svc()->zone->get_sync_policy_handler(zone_id); + auto zone_policy_handler = store->get_zone()->get_sync_policy_handler(); RGWBucketSyncPolicyHandlerRef bucket_handler; @@ -2804,7 +2802,7 @@ static int sync_info(std::optional opt_target_zone, std::optionalget_zone()->get_zonegroup(); @@ -2842,7 +2840,7 @@ static int bucket_sync_info(rgw::sal::RadosStore* store, const RGWBucketInfo& in return 0; } -static int bucket_sync_status(rgw::sal::RadosStore* store, const RGWBucketInfo& info, +static int bucket_sync_status(rgw::sal::Store* store, const RGWBucketInfo& info, const rgw_zone_id& source_zone_id, std::optional& opt_source_bucket, std::ostream& out) @@ -2878,21 +2876,26 @@ static int bucket_sync_status(rgw::sal::RadosStore* store, const RGWBucketInfo& set zone_ids; if (!source_zone_id.empty()) { - auto z = static_cast(store)->svc()->zone->get_zonegroup().zones.find(source_zone_id); - if (z == static_cast(store)->svc()->zone->get_zonegroup().zones.end()) { + std::unique_ptr zone; + int ret = store->get_zone()->get_zonegroup().get_zone_by_id(source_zone_id.id, &zone); + if (ret < 0) { ldpp_dout(dpp(), -1) << "Source zone not found in zonegroup " << zonegroup.get_name() << dendl; return -EINVAL; } auto c = zone_conn_map.find(source_zone_id); if (c == zone_conn_map.end()) { - ldpp_dout(dpp(), -1) << "No connection to zone " << z->second.name << dendl; + ldpp_dout(dpp(), -1) << "No connection to zone " << zone->get_name() << dendl; return -EINVAL; } zone_ids.insert(source_zone_id); } else { - for (const auto& entry : static_cast(store)->svc()->zone->get_zonegroup().zones) { - zone_ids.insert(entry.second.id); + std::list ids; + int ret = store->get_zone()->get_zonegroup().list_zones(ids); + if (ret == 0) { + for (const auto& entry : ids) { + zone_ids.insert(entry); + } } } @@ -2913,7 +2916,7 @@ static int bucket_sync_status(rgw::sal::RadosStore* store, const RGWBucketInfo& continue; } if (pipe.source.zone.value_or(rgw_zone_id()) == z->second.id) { - bucket_source_sync_status(dpp(), store, static_cast(store)->svc()->zone->get_zone(), z->second, + bucket_source_sync_status(dpp(), static_cast(store), static_cast(store)->svc()->zone->get_zone(), z->second, c->second, info, pipe, width, out); @@ -2976,7 +2979,7 @@ static int check_pool_support_omap(const rgw_pool& pool) return 0; } -int check_reshard_bucket_params(rgw::sal::RadosStore* store, +int check_reshard_bucket_params(rgw::sal::Store* store, const string& bucket_name, const string& tenant, const string& bucket_id, @@ -3087,10 +3090,6 @@ static int trim_sync_error_log(int shard_id, const string& marker, int delay_ms) // unreachable } -const string& get_tier_type(rgw::sal::RadosStore* store) { - return store->svc()->zone->get_zone().tier_type; -} - static bool symmetrical_flow_opt(const string& opt) { return (opt == "symmetrical" || opt == "symmetric"); @@ -3229,9 +3228,13 @@ void resolve_zone_id_opt(std::optional& zone_name, std::optional(store)->svc()->zone->find_zone_id_by_name(*zone_name, &(*zone_id))) { + std::unique_ptr zone; + int ret = store->get_zone()->get_zonegroup().get_zone_by_name(*zone_name, &zone); + if (ret < 0) { cerr << "WARNING: cannot find source zone id for name=" << *zone_name << std::endl; zone_id = rgw_zone_id(*zone_name); + } else { + zone_id->id = zone->get_id(); } } void resolve_zone_ids_opt(std::optional >& names, std::optional >& ids) @@ -3242,9 +3245,13 @@ void resolve_zone_ids_opt(std::optional >& names, std::optional(store)->svc()->zone->find_zone_id_by_name(name, &zid)) { + std::unique_ptr zone; + int ret = store->get_zone()->get_zonegroup().get_zone_by_name(name, &zone); + if (ret < 0) { cerr << "WARNING: cannot find source zone id for name=" << name << std::endl; zid = rgw_zone_id(name); + } else { + zid.id = zone->get_id(); } ids->push_back(zid); } @@ -3266,9 +3273,9 @@ class JSONFormatter_PrettyZone : public JSONFormatter { void encode_json(const char *name, const void *pval, ceph::Formatter *f) const override { auto zone_id = *(static_cast(pval)); string zone_name; - RGWZone *zone; - if ((zone = static_cast(store)->svc()->zone->find_zone(zone_id))) { - zone_name = zone->name; + std::unique_ptr zone; + if (store->get_zone()->get_zonegroup().get_zone_by_id(zone_id.id, &zone) == 0) { + zone_name = zone->get_name(); } else { cerr << "WARNING: cannot find zone name for id=" << zone_id << std::endl; zone_name = zone_id.id; @@ -4473,9 +4480,12 @@ int main(int argc, const char **argv) } if (!source_zone_name.empty()) { - if (!static_cast(store)->svc()->zone->find_zone_id_by_name(source_zone_name, &source_zone)) { + std::unique_ptr zone; + if (store->get_zone()->get_zonegroup().get_zone_by_name(source_zone_name, &zone) < 0) { cerr << "WARNING: cannot find source zone id for name=" << source_zone_name << std::endl; source_zone = source_zone_name; + } else { + source_zone.id = zone->get_id(); } } @@ -4492,7 +4502,7 @@ int main(int argc, const char **argv) oath_init(); - StoreDestructor store_destructor(static_cast(store)); + StoreDestructor store_destructor(store); if (raw_storage_op) { try_to_resolve_local_entities(realm_id, realm_name, @@ -4552,7 +4562,7 @@ int main(int argc, const char **argv) break; case OPT::PERIOD_GET_CURRENT: { - int ret = read_current_period_id(static_cast(store), realm_id, realm_name, &period_id); + int ret = read_current_period_id(store, realm_id, realm_name, &period_id); if (ret < 0) { return -ret; } @@ -4902,7 +4912,7 @@ int main(int argc, const char **argv) break; case OPT::REALM_LIST_PERIODS: { - int ret = read_current_period_id(static_cast(store), realm_id, realm_name, &period_id); + int ret = read_current_period_id(store, realm_id, realm_name, &period_id); if (ret < 0) { return -ret; } @@ -5919,7 +5929,7 @@ int main(int argc, const char **argv) case OPT::ZONE_LIST: { list zones; - int ret = static_cast(store)->svc()->zone->list_zones(dpp(), zones); + int ret = store->list_all_zones(dpp(), zones); if (ret < 0) { cerr << "failed to list zones: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -7826,7 +7836,7 @@ next: } if (opt_cmd == OPT::BUCKET_RESHARD) { - int ret = check_reshard_bucket_params(static_cast(store), + int ret = check_reshard_bucket_params(store, bucket_name, tenant, bucket_id, @@ -7877,7 +7887,7 @@ next: } if (opt_cmd == OPT::RESHARD_ADD) { - int ret = check_reshard_bucket_params(static_cast(store), + int ret = check_reshard_bucket_params(store, bucket_name, tenant, bucket_id, @@ -8450,9 +8460,7 @@ next: RGWStorageStats stats(omit_utilized_stats); ceph::real_time last_stats_sync; ceph::real_time last_stats_update; - int ret = static_cast(store)->ctl()->user->read_stats(dpp(), user->get_id(), &stats, null_yield, - &last_stats_sync, - &last_stats_update); + int ret = user->read_stats(dpp(), null_yield, &stats, &last_stats_sync, &last_stats_update); if (ret < 0) { if (ret == -ENOENT) { /* in case of ENOENT */ cerr << "User has not been initialized or user does not exist" << std::endl; @@ -8583,7 +8591,7 @@ next: int i = (specified_shard_id ? shard_id : 0); if (period_id.empty()) { - int ret = read_current_period_id(static_cast(store), realm_id, realm_name, &period_id); + int ret = read_current_period_id(store, realm_id, realm_name, &period_id); if (ret < 0) { return -ret; } @@ -8628,7 +8636,7 @@ next: int i = (specified_shard_id ? shard_id : 0); if (period_id.empty()) { - int ret = read_current_period_id(static_cast(store), realm_id, realm_name, &period_id); + int ret = read_current_period_id(store, realm_id, realm_name, &period_id); if (ret < 0) { return -ret; } @@ -9035,7 +9043,7 @@ next: if (ret < 0) { return -ret; } - bucket_sync_info(static_cast(store), bucket->get_info(), std::cout); + bucket_sync_info(store, bucket->get_info(), std::cout); } if (opt_cmd == OPT::BUCKET_SYNC_STATUS) { @@ -9047,7 +9055,7 @@ next: if (ret < 0) { return -ret; } - bucket_sync_status(static_cast(store), bucket->get_info(), source_zone, opt_source_bucket, std::cout); + bucket_sync_status(store, bucket->get_info(), source_zone, opt_source_bucket, std::cout); } if (opt_cmd == OPT::BUCKET_SYNC_MARKERS) { @@ -10280,7 +10288,7 @@ next: } if (opt_cmd == OPT::PUBSUB_SUB_GET) { - if (get_tier_type(static_cast(store)) != "pubsub") { + if (store->get_zone()->get_tier_type() != "pubsub") { cerr << "ERROR: only pubsub tier type supports this command" << std::endl; return EINVAL; } @@ -10304,7 +10312,7 @@ next: } if (opt_cmd == OPT::PUBSUB_SUB_RM) { - if (get_tier_type(static_cast(store)) != "pubsub") { + if (store->get_zone()->get_tier_type() != "pubsub") { cerr << "ERROR: only pubsub tier type supports this command" << std::endl; return EINVAL; } @@ -10324,7 +10332,7 @@ next: } if (opt_cmd == OPT::PUBSUB_SUB_PULL) { - if (get_tier_type(static_cast(store)) != "pubsub") { + if (store->get_zone()->get_tier_type() != "pubsub") { cerr << "ERROR: only pubsub tier type supports this command" << std::endl; return EINVAL; } @@ -10349,7 +10357,7 @@ next: } if (opt_cmd == OPT::PUBSUB_EVENT_RM) { - if (get_tier_type(static_cast(store)) != "pubsub") { + if (store->get_zone()->get_tier_type() != "pubsub") { cerr << "ERROR: only pubsub tier type supports this command" << std::endl; return EINVAL; } @@ -10458,7 +10466,7 @@ next: cerr << "ERROR: lua package name was not provided (via --package)" << std::endl; return EINVAL; } - const auto rc = rgw::lua::add_package(dpp(), static_cast(store), null_yield, *script_package, bool(allow_compilation)); + const auto rc = rgw::lua::add_package(dpp(), store, null_yield, *script_package, bool(allow_compilation)); if (rc < 0) { cerr << "ERROR: failed to add lua package: " << script_package << " .error: " << rc << std::endl; return -rc; @@ -10475,7 +10483,7 @@ next: cerr << "ERROR: lua package name was not provided (via --package)" << std::endl; return EINVAL; } - const auto rc = rgw::lua::remove_package(dpp(), static_cast(store), null_yield, *script_package); + const auto rc = rgw::lua::remove_package(dpp(), store, null_yield, *script_package); if (rc == -ENOENT) { cerr << "WARNING: package " << script_package << " did not exists or already removed" << std::endl; return 0; @@ -10493,7 +10501,7 @@ next: if (opt_cmd == OPT::SCRIPT_PACKAGE_LIST) { #ifdef WITH_RADOSGW_LUA_PACKAGES rgw::lua::packages_t packages; - const auto rc = rgw::lua::list_packages(dpp(), static_cast(store), null_yield, packages); + const auto rc = rgw::lua::list_packages(dpp(), store, null_yield, packages); if (rc == -ENOENT) { std::cout << "no lua packages in allowlist" << std::endl; } else if (rc < 0) { diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index e6669479719e..46280e666239 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -316,6 +316,8 @@ class Store { virtual std::string zone_unique_trans_id(const uint64_t unique_num) = 0; /** Lookup a zonegroup by ID */ virtual int get_zonegroup(const std::string& id, std::unique_ptr* zonegroup) = 0; + /** List all zones in all zone groups by ID */ + virtual int list_all_zones(const DoutPrefixProvider* dpp, std::list& zone_ids) = 0; /** Get statistics about the cluster represented by this Store */ virtual int cluster_stat(RGWClusterStat& stats) = 0; /** Get a @a Lifecycle object. Used to manage/run lifecycle transitions */ @@ -1467,6 +1469,8 @@ public: virtual int get_zone_by_id(const std::string& id, std::unique_ptr* zone) = 0; /** Get a zone by Name */ virtual int get_zone_by_name(const std::string& name, std::unique_ptr* zone) = 0; + /** List zones in zone group by ID */ + virtual int list_zones(std::list& zone_ids) = 0; /** Clone a copy of this zonegroup. */ virtual std::unique_ptr clone() = 0; }; @@ -1505,6 +1509,8 @@ class Zone { virtual const std::string& get_realm_id() = 0; /** Get the tier type for the zone */ virtual const std::string_view get_tier_type() = 0; + /** Get a handler for zone sync policy. */ + virtual RGWBucketSyncPolicyHandlerRef get_sync_policy_handler() = 0; }; /** diff --git a/src/rgw/rgw_sal_dbstore.cc b/src/rgw/rgw_sal_dbstore.cc index 970f3edbde5a..e8f39b43243e 100644 --- a/src/rgw/rgw_sal_dbstore.cc +++ b/src/rgw/rgw_sal_dbstore.cc @@ -597,6 +597,11 @@ namespace rgw::sal { return realm->get_id(); } + RGWBucketSyncPolicyHandlerRef DBZone::get_sync_policy_handler() + { + return nullptr; + } + std::unique_ptr DBStore::get_lua_manager() { return std::make_unique(this); @@ -1751,6 +1756,13 @@ namespace rgw::sal { return 0; } + int DBStore::list_all_zones(const DoutPrefixProvider* dpp, + std::list& zone_ids) + { + zone_ids.push_back(zone.get_id()); + return 0; + } + int DBStore::cluster_stat(RGWClusterStat& stats) { return 0; diff --git a/src/rgw/rgw_sal_dbstore.h b/src/rgw/rgw_sal_dbstore.h index 7f10ba7e75a4..85c320432bb6 100644 --- a/src/rgw/rgw_sal_dbstore.h +++ b/src/rgw/rgw_sal_dbstore.h @@ -296,6 +296,10 @@ protected: virtual int get_zone_by_name(const std::string& name, std::unique_ptr* zone) override { return -1; } + virtual int list_zones(std::list& zone_ids) override { + zone_ids.clear(); + return 0; + } virtual std::unique_ptr clone() override { std::unique_ptrzg = std::make_unique(*group.get()); return std::make_unique(store, std::move(zg)); @@ -349,6 +353,7 @@ protected: virtual const std::string& get_realm_name() override; virtual const std::string& get_realm_id() override; virtual const std::string_view get_tier_type() override { return "rgw"; } + virtual RGWBucketSyncPolicyHandlerRef get_sync_policy_handler() override; }; class DBLuaManager : public StoreLuaManager { @@ -791,6 +796,7 @@ public: virtual std::string zone_unique_id(uint64_t unique_num) override; virtual std::string zone_unique_trans_id(const uint64_t unique_num) override; virtual int get_zonegroup(const std::string& id, std::unique_ptr* zonegroup) override; + virtual int list_all_zones(const DoutPrefixProvider* dpp, std::list& zone_ids) override; virtual int cluster_stat(RGWClusterStat& stats) override; virtual std::unique_ptr get_lifecycle(void) override; virtual std::unique_ptr get_completions(void) override; diff --git a/src/rgw/rgw_sal_filter.h b/src/rgw/rgw_sal_filter.h index d64952a3d5bb..a422d2b4c236 100644 --- a/src/rgw/rgw_sal_filter.h +++ b/src/rgw/rgw_sal_filter.h @@ -81,6 +81,8 @@ public: virtual int get_placement_tier(const rgw_placement_rule& rule, std::unique_ptr* tier) override; virtual int get_zone_by_id(const std::string& id, std::unique_ptr* zone) override; virtual int get_zone_by_name(const std::string& name, std::unique_ptr* zone) override; + virtual int list_zones(std::list& zone_ids) override + { return next->list_zones(zone_ids); } virtual std::unique_ptr clone() override { std::unique_ptr nzg = next->clone(); return std::make_unique(std::move(nzg)); @@ -137,6 +139,9 @@ public: virtual const std::string_view get_tier_type() override { return next->get_tier_type(); } + virtual RGWBucketSyncPolicyHandlerRef get_sync_policy_handler() override { + return next->get_sync_policy_handler(); + } }; class FilterStore : public Store { @@ -188,6 +193,9 @@ public: virtual std::string zone_unique_id(uint64_t unique_num) override; virtual std::string zone_unique_trans_id(const uint64_t unique_num) override; virtual int get_zonegroup(const std::string& id, std::unique_ptr* zonegroup) override; + virtual int list_all_zones(const DoutPrefixProvider* dpp, std::list& zone_ids) override { + return next->list_all_zones(dpp, zone_ids); + } virtual int cluster_stat(RGWClusterStat& stats) override; virtual std::unique_ptr get_lifecycle(void) override; virtual std::unique_ptr get_completions(void) override; diff --git a/src/rgw/rgw_sal_motr.cc b/src/rgw/rgw_sal_motr.cc index d4b91faaf4ad..a40b1ac896be 100644 --- a/src/rgw/rgw_sal_motr.cc +++ b/src/rgw/rgw_sal_motr.cc @@ -2949,6 +2949,13 @@ int MotrStore::get_zonegroup(const std::string& id, std::unique_ptr* return 0; } +int MotrStore::list_all_zones(const DoutPrefixProvider* dpp, + std::list& zone_ids) +{ + zone_ids.push_back(zone.get_id()); + return 0; +} + int MotrStore::cluster_stat(RGWClusterStat& stats) { return 0; diff --git a/src/rgw/rgw_sal_motr.h b/src/rgw/rgw_sal_motr.h index 91e45d5e5cc3..b773d0eab102 100644 --- a/src/rgw/rgw_sal_motr.h +++ b/src/rgw/rgw_sal_motr.h @@ -409,6 +409,10 @@ public: virtual int get_zone_by_name(const std::string& name, std::unique_ptr* zone) override { return -1; } + virtual int list_zones(std::list& zone_ids) override { + zone_ids.clear(); + return 0; + } const RGWZoneGroup& get_group() { return group; } virtual std::unique_ptr clone() override { return std::make_unique(store, group); @@ -467,6 +471,7 @@ class MotrZone : public StoreZone { virtual const std::string& get_realm_name() { return realm->get_name(); } virtual const std::string& get_realm_id() { return realm->get_id(); } virtual const std::string_view get_tier_type() { return "rgw"; } + virtual RGWBucketSyncPolicyHandlerRef get_sync_policy_handler() { return nullptr; } friend class MotrStore; }; @@ -932,6 +937,7 @@ class MotrStore : public StoreStore { virtual std::string zone_unique_id(uint64_t unique_num) override; virtual std::string zone_unique_trans_id(const uint64_t unique_num) override; virtual int get_zonegroup(const std::string& id, std::unique_ptr* zonegroup) override; + virtual int list_all_zones(const DoutPrefixProvider* dpp, std::list& zone_ids) override; virtual int cluster_stat(RGWClusterStat& stats) override; virtual std::unique_ptr get_lifecycle(void) override; virtual std::unique_ptr get_completions(void) override; diff --git a/src/rgw/rgw_sal_rados.cc b/src/rgw/rgw_sal_rados.cc index 25d01dc8b373..79b3915e5660 100644 --- a/src/rgw/rgw_sal_rados.cc +++ b/src/rgw/rgw_sal_rados.cc @@ -1232,6 +1232,11 @@ int RadosStore::get_zonegroup(const std::string& id, return 0; } +int RadosStore::list_all_zones(const DoutPrefixProvider* dpp, std::list& zone_ids) +{ + return svc()->zone->list_zones(dpp, zone_ids); +} + int RadosStore::cluster_stat(RGWClusterStat& stats) { rados_cluster_stat_t rados_stats; @@ -3019,6 +3024,15 @@ int RadosZoneGroup::get_zone_by_name(const std::string& name, std::unique_ptr& zone_ids) +{ + for (const auto& entry : group.zones) + { + zone_ids.push_back(entry.second.id); + } + return 0; +} + std::unique_ptr RadosZone::clone() { if (local_zone) @@ -3093,6 +3107,11 @@ const std::string_view RadosZone::get_tier_type() return rgw_zone.id; } +RGWBucketSyncPolicyHandlerRef RadosZone::get_sync_policy_handler() +{ + return store->svc()->zone->get_sync_policy_handler(get_id()); +} + RadosLuaManager::RadosLuaManager(RadosStore* _s) : store(_s), pool((store->svc() && store->svc()->zone) ? store->svc()->zone->get_zone_params().log_pool : rgw_pool()) diff --git a/src/rgw/rgw_sal_rados.h b/src/rgw/rgw_sal_rados.h index 91677d838d7a..d183d68d755d 100644 --- a/src/rgw/rgw_sal_rados.h +++ b/src/rgw/rgw_sal_rados.h @@ -87,6 +87,7 @@ public: virtual int get_placement_tier(const rgw_placement_rule& rule, std::unique_ptr* tier); virtual int get_zone_by_id(const std::string& id, std::unique_ptr* zone) override; virtual int get_zone_by_name(const std::string& name, std::unique_ptr* zone) override; + virtual int list_zones(std::list& zone_ids) override; virtual std::unique_ptr clone() override { return std::make_unique(store, group); } @@ -115,7 +116,8 @@ class RadosZone : public StoreZone { virtual const RGWAccessKey& get_system_key() override; virtual const std::string& get_realm_name() override; virtual const std::string& get_realm_id() override; - virtual const std::string_view get_tier_type() override; + virtual const std::string_view get_tier_type() override; + virtual RGWBucketSyncPolicyHandlerRef get_sync_policy_handler() override; }; class RadosStore : public StoreStore { @@ -158,6 +160,7 @@ class RadosStore : public StoreStore { virtual std::string zone_unique_id(uint64_t unique_num) override; virtual std::string zone_unique_trans_id(const uint64_t unique_num) override; virtual int get_zonegroup(const std::string& id, std::unique_ptr* zonegroup) override; + virtual int list_all_zones(const DoutPrefixProvider* dpp, std::list& zone_ids) override; virtual int cluster_stat(RGWClusterStat& stats) override; virtual std::unique_ptr get_lifecycle(void) override; virtual std::unique_ptr get_completions(void) override;