#include "rgw_role.h"
#include "rgw_reshard.h"
#include "rgw_http_client_curl.h"
+#include "rgw_zone.h"
+
+#include "services/svc_sync_modules.h"
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
{
boost::optional<RGWRESTConn> conn;
if (remote == zonegroup.get_id()) {
- conn.emplace(store->ctx(), store, remote, zonegroup.endpoints);
+ conn.emplace(store->ctx(), store->svc.zone, remote, zonegroup.endpoints);
} else {
for (const auto& z : zonegroup.zones) {
const auto& zone = z.second;
if (remote == zone.id) {
- conn.emplace(store->ctx(), store, remote, zone.endpoints);
+ conn.emplace(store->ctx(), store->svc.zone, remote, zone.endpoints);
break;
}
}
return -EINVAL;
}
// are we the period's master zone?
- if (store->get_zone_params().get_id() == master_zone) {
+ if (store->svc.zone->get_zone_params().get_id() == master_zone) {
// read the current period
RGWPeriod current_period;
- int ret = current_period.init(g_ceph_context, store, realm.get_id());
+ int ret = current_period.init(g_ceph_context, store->svc.sysobj, realm.get_id());
if (ret < 0) {
cerr << "Error initializing current period: "
<< cpp_strerror(-ret) << std::endl;
return ret;
}
// the master zone can commit locally
- ret = period.commit(realm, current_period, cerr, force);
+ ret = period.commit(store, realm, current_period, cerr, force);
if (ret < 0) {
cerr << "failed to commit period: " << cpp_strerror(-ret) << std::endl;
}
Formatter *formatter, bool force)
{
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, store);
+ int ret = realm.init(g_ceph_context, store->svc.sysobj);
if (ret < 0 ) {
cerr << "Error initializing realm " << cpp_strerror(-ret) << std::endl;
return ret;
epoch = atoi(period_epoch.c_str());
}
RGWPeriod period(period_id, epoch);
- ret = period.init(g_ceph_context, store, realm.get_id());
+ ret = period.init(g_ceph_context, store->svc.sysobj, realm.get_id());
if (ret < 0) {
cerr << "period init failed: " << cpp_strerror(-ret) << std::endl;
return ret;
cerr << "request failed: " << cpp_strerror(-ret) << std::endl;
return ret;
}
- ret = period->init(g_ceph_context, store, false);
+ ret = period->init(g_ceph_context, store->svc.sysobj, false);
if (ret < 0) {
cerr << "faile to init period " << cpp_strerror(-ret) << std::endl;
return ret;
std::string* period_id)
{
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, store);
+ int ret = realm.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
std::cerr << "failed to read realm: " << cpp_strerror(-ret) << std::endl;
return ret;
push_ss(ss, status) << "incremental sync: " << num_inc << "/" << total_shards << " shards";
map<int, RGWMetadataLogInfo> master_shards_info;
- string master_period = store->get_current_period_id();
+ string master_period = store->svc.zone->get_current_period_id();
ret = sync.read_master_log_shards_info(master_period, &master_shards_info);
if (ret < 0) {
{
stringstream ss;
- auto ziter = store->zone_by_id.find(source_zone);
- if (ziter == store->zone_by_id.end()) {
+ RGWZone *sz;
+
+ if (!store->svc.zone->find_zone_by_id(source_zone, &sz)) {
push_ss(ss, status, tab) << string("zone not found");
flush_ss(ss, status);
return;
}
- RGWZone& sz = ziter->second;
- if (!store->zone_syncs_from(store->get_zone(), sz)) {
+ if (!store->svc.zone->zone_syncs_from(store->svc.zone->get_zone(), *sz)) {
push_ss(ss, status, tab) << string("not syncing from zone");
flush_ss(ss, status);
return;
static void sync_status(Formatter *formatter)
{
- RGWRealm& realm = store->realm;
- RGWZoneGroup& zonegroup = store->get_zonegroup();
- RGWZone& zone = store->get_zone();
+ RGWRealm& realm = store->svc.zone->get_realm();
+ RGWZoneGroup& zonegroup = store->svc.zone->get_zonegroup();
+ RGWZone& zone = store->svc.zone->get_zone();
int width = 15;
list<string> md_status;
- if (store->is_meta_master()) {
+ if (store->svc.zone->is_meta_master()) {
md_status.push_back("no sync (zone is master)");
} else {
get_md_sync_status(md_status);
list<string> data_status;
- for (auto iter : store->zone_conn_map) {
+ auto& zone_conn_map = store->svc.zone->get_zone_conn_map();
+
+ for (auto iter : zone_conn_map) {
const string& source_id = iter.first;
string source_str = "source: ";
string s = source_str + source_id;
- auto siter = store->zone_by_id.find(source_id);
- if (siter != store->zone_by_id.end()) {
- s += string(" (") + siter->second.name + ")";
+ RGWZone *sz;
+ if (store->svc.zone->find_zone_by_id(source_id, &sz)) {
+ s += string(" (") + sz->name + ")";
}
data_status.push_back(s);
get_data_sync_status(source_id, data_status, source_str.size());
const std::string& source_zone_id,
std::ostream& out)
{
- RGWRealm& realm = store->realm;
- RGWZoneGroup& zonegroup = store->get_zonegroup();
- RGWZone& zone = store->get_zone();
+ RGWRealm& realm = store->svc.zone->get_realm();
+ RGWZoneGroup& zonegroup = store->svc.zone->get_zonegroup();
+ RGWZone& zone = store->svc.zone->get_zone();
constexpr int width = 15;
out << indented{width, "realm"} << realm.get_id() << " (" << realm.get_name() << ")\n";
return 0;
}
+ auto& zone_conn_map = store->svc.zone->get_zone_conn_map();
if (!source_zone_id.empty()) {
auto z = zonegroup.zones.find(source_zone_id);
if (z == zonegroup.zones.end()) {
<< zonegroup.get_name() << dendl;
return -EINVAL;
}
- auto c = store->zone_conn_map.find(source_zone_id);
- if (c == store->zone_conn_map.end()) {
+ auto c = zone_conn_map.find(source_zone_id);
+ if (c == zone_conn_map.end()) {
lderr(store->ctx()) << "No connection to zone " << z->second.name << dendl;
return -EINVAL;
}
}
for (const auto& z : zonegroup.zones) {
- auto c = store->zone_conn_map.find(z.second.id);
- if (c != store->zone_conn_map.end()) {
+ auto c = zone_conn_map.find(z.second.id);
+ if (c != zone_conn_map.end()) {
bucket_source_sync_status(store, zone, z.second, c->second,
info, width, out);
}
}
if (!source_zone_name.empty()) {
- if (!store->find_zone_id_by_name(source_zone_name, &source_zone)) {
+ if (!store->svc.zone->find_zone_id_by_name(source_zone_name, &source_zone)) {
cerr << "WARNING: cannot find source zone id for name=" << source_zone_name << std::endl;
source_zone = source_zone_name;
}
return EINVAL;
}
RGWPeriod period(period_id);
- int ret = period.init(g_ceph_context, store);
+ int ret = period.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "period.init failed: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
if (staging) {
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, store);
+ int ret = realm.init(g_ceph_context, store->svc.sysobj);
if (ret < 0 ) {
cerr << "Error initializing realm " << cpp_strerror(-ret) << std::endl;
return -ret;
epoch = 1;
}
RGWPeriod period(period_id, epoch);
- int ret = period.init(g_ceph_context, store, realm_id, realm_name);
+ int ret = period.init(g_ceph_context, store->svc.sysobj, realm_id, realm_name);
if (ret < 0) {
cerr << "period init failed: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT_PERIOD_LIST:
{
list<string> periods;
- int ret = store->list_periods(periods);
+ int ret = store->svc.zone->list_periods(periods);
if (ret < 0) {
cerr << "failed to list periods: " << cpp_strerror(-ret) << std::endl;
return -ret;
if (url.empty()) {
// load current period for endpoints
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, store);
+ int ret = realm.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init realm: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWPeriod current_period(realm.get_current_period());
- ret = current_period.init(g_ceph_context, store);
+ ret = current_period.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init current period: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT_GLOBAL_QUOTA_DISABLE:
{
if (realm_id.empty()) {
- RGWRealm realm(g_ceph_context, store);
+ RGWRealm realm(g_ceph_context, store->svc.sysobj);
if (!realm_name.empty()) {
// look up realm_id for the given realm_name
int ret = realm.read_id(realm_name, realm_id);
}
RGWPeriodConfig period_config;
- int ret = period_config.read(store, realm_id);
+ int ret = period_config.read(store->svc.sysobj, realm_id);
if (ret < 0 && ret != -ENOENT) {
cerr << "ERROR: failed to read period config: "
<< cpp_strerror(-ret) << std::endl;
if (opt_cmd != OPT_GLOBAL_QUOTA_GET) {
// write the modified period config
- ret = period_config.write(store, realm_id);
+ ret = period_config.write(store->svc.sysobj, realm_id);
if (ret < 0) {
cerr << "ERROR: failed to write period config: "
<< cpp_strerror(-ret) << std::endl;
return EINVAL;
}
- RGWRealm realm(realm_name, g_ceph_context, store);
+ RGWRealm realm(realm_name, g_ceph_context, store->svc.sysobj);
int ret = realm.create();
if (ret < 0) {
cerr << "ERROR: couldn't create realm " << realm_name << ": " << cpp_strerror(-ret) << std::endl;
cerr << "missing realm name or id" << std::endl;
return EINVAL;
}
- int ret = realm.init(g_ceph_context, store);
+ int ret = realm.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "realm.init failed: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT_REALM_GET:
{
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, store);
+ int ret = realm.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
if (ret == -ENOENT && realm_name.empty() && realm_id.empty()) {
cerr << "missing realm name or id, or default realm not found" << std::endl;
break;
case OPT_REALM_GET_DEFAULT:
{
- RGWRealm realm(g_ceph_context, store);
+ RGWRealm realm(g_ceph_context, store->svc.sysobj);
string default_id;
int ret = realm.read_default_id(default_id);
if (ret == -ENOENT) {
break;
case OPT_REALM_LIST:
{
- RGWRealm realm(g_ceph_context, store);
+ RGWRealm realm(g_ceph_context, store->svc.sysobj);
string default_id;
int ret = realm.read_default_id(default_id);
if (ret < 0 && ret != -ENOENT) {
cerr << "could not determine default realm: " << cpp_strerror(-ret) << std::endl;
}
list<string> realms;
- ret = store->list_realms(realms);
+ ret = store->svc.zone->list_realms(realms);
if (ret < 0) {
cerr << "failed to list realms: " << cpp_strerror(-ret) << std::endl;
return -ret;
return -ret;
}
list<string> periods;
- ret = store->list_periods(period_id, periods);
+ ret = store->svc.zone->list_periods(period_id, periods);
if (ret < 0) {
cerr << "list periods failed: " << cpp_strerror(-ret) << std::endl;
return -ret;
cerr << "missing realm name or id" << std::endl;
return EINVAL;
}
- int ret = realm.init(g_ceph_context, store);
+ int ret = realm.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "realm.init failed: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWRealm realm(realm_id, realm_name);
bool new_realm = false;
- int ret = realm.init(g_ceph_context, store);
+ int ret = realm.init(g_ceph_context, store->svc.sysobj);
if (ret < 0 && ret != -ENOENT) {
cerr << "failed to init realm: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT_REALM_DEFAULT:
{
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, store);
+ int ret = realm.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init realm: " << cpp_strerror(-ret) << std::endl;
return -ret;
return -ret;
}
RGWRealm realm;
- realm.init(g_ceph_context, store, false);
+ realm.init(g_ceph_context, store->svc.sysobj, false);
try {
decode_json_obj(realm, &p);
} catch (JSONDecoder::err& e) {
}
RGWZoneGroup zonegroup(zonegroup_id,zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, store);
+ int ret = zonegroup.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to initialize zonegroup " << zonegroup_name << " id " << zonegroup_id << " :"
<< cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWZoneParams zone(zone_id, zone_name);
- ret = zone.init(g_ceph_context, store);
+ ret = zone.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
return EINVAL;
}
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, store);
+ int ret = realm.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init realm: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
- RGWZoneGroup zonegroup(zonegroup_name, is_master, g_ceph_context, store, realm.get_id(), endpoints);
+ RGWZoneGroup zonegroup(zonegroup_name, is_master, g_ceph_context, store->svc.sysobj, realm.get_id(), endpoints);
zonegroup.api_name = (api_name.empty() ? zonegroup_name : api_name);
ret = zonegroup.create();
if (ret < 0) {
}
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, store);
+ int ret = zonegroup.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
return EINVAL;
}
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, store);
+ int ret = zonegroup.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT_ZONEGROUP_GET:
{
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, store);
+ int ret = zonegroup.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT_ZONEGROUP_LIST:
{
RGWZoneGroup zonegroup;
- int ret = zonegroup.init(g_ceph_context, store, false);
+ int ret = zonegroup.init(g_ceph_context, store->svc.sysobj, false);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
list<string> zonegroups;
- ret = store->list_zonegroups(zonegroups);
+ ret = store->svc.zone->list_zonegroups(zonegroups);
if (ret < 0) {
cerr << "failed to list zonegroups: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT_ZONEGROUP_MODIFY:
{
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, store);
+ int ret = realm.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init realm: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- ret = zonegroup.init(g_ceph_context, store);
+ ret = zonegroup.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
need_update = true;
} else if (!realm_name.empty()) {
// get realm id from name
- RGWRealm realm{g_ceph_context, store};
+ RGWRealm realm{g_ceph_context, store->svc.sysobj};
ret = realm.read_id(realm_name, zonegroup.realm_id);
if (ret < 0) {
cerr << "failed to find realm by name " << realm_name << std::endl;
case OPT_ZONEGROUP_SET:
{
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, store);
+ int ret = realm.init(g_ceph_context, store->svc.sysobj);
bool default_realm_not_exist = (ret == -ENOENT && realm_id.empty() && realm_name.empty());
if (ret < 0 && !default_realm_not_exist ) {
}
RGWZoneGroup zonegroup;
- ret = zonegroup.init(g_ceph_context, store, false);
+ ret = zonegroup.init(g_ceph_context, store->svc.sysobj, false);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT_ZONEGROUP_REMOVE:
{
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, store);
+ int ret = zonegroup.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
return EINVAL;
}
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, store);
+ int ret = zonegroup.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT_ZONEGROUP_PLACEMENT_LIST:
{
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, store);
+ int ret = zonegroup.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, store);
+ int ret = zonegroup.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
/* if the user didn't provide zonegroup info , create stand alone zone */
if (!zonegroup_id.empty() || !zonegroup_name.empty()) {
- ret = zonegroup.init(g_ceph_context, store);
+ ret = zonegroup.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "unable to initialize zonegroup " << zonegroup_name << ": " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWZoneParams zone(zone_id, zone_name);
- ret = zone.init(g_ceph_context, store, false);
+ ret = zone.init(g_ceph_context, store->svc.sysobj, false);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT_ZONE_DEFAULT:
{
RGWZoneGroup zonegroup(zonegroup_id,zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, store);
+ int ret = zonegroup.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "WARNING: failed to initialize zonegroup " << zonegroup_name << std::endl;
}
return EINVAL;
}
RGWZoneParams zone(zone_id, zone_name);
- ret = zone.init(g_ceph_context, store);
+ ret = zone.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
return EINVAL;
}
RGWZoneParams zone(zone_id, zone_name);
- int ret = zone.init(g_ceph_context, store);
+ int ret = zone.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
list<string> zonegroups;
- ret = store->list_zonegroups(zonegroups);
+ ret = store->svc.zone->list_zonegroups(zonegroups);
if (ret < 0) {
cerr << "failed to list zonegroups: " << cpp_strerror(-ret) << std::endl;
return -ret;
for (list<string>::iterator iter = zonegroups.begin(); iter != zonegroups.end(); ++iter) {
RGWZoneGroup zonegroup(string(), *iter);
- int ret = zonegroup.init(g_ceph_context, store);
+ int ret = zonegroup.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "WARNING: failed to initialize zonegroup " << zonegroup_name << std::endl;
continue;
case OPT_ZONE_GET:
{
RGWZoneParams zone(zone_id, zone_name);
- int ret = zone.init(g_ceph_context, store);
+ int ret = zone.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT_ZONE_SET:
{
RGWZoneParams zone(zone_name);
- int ret = zone.init(g_ceph_context, store, false);
+ int ret = zone.init(g_ceph_context, store->svc.sysobj, false);
if (ret < 0) {
return -ret;
}
if(zone.realm_id.empty()) {
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, store);
+ int ret = realm.init(g_ceph_context, store->svc.sysobj);
if (ret < 0 && ret != -ENOENT) {
cerr << "failed to init realm: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT_ZONE_LIST:
{
list<string> zones;
- int ret = store->list_zones(zones);
+ int ret = store->svc.zone->list_zones(zones);
if (ret < 0) {
cerr << "failed to list zones: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWZoneParams zone;
- ret = zone.init(g_ceph_context, store, false);
+ ret = zone.init(g_ceph_context, store->svc.sysobj, false);
if (ret < 0) {
cerr << "failed to init zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT_ZONE_MODIFY:
{
RGWZoneParams zone(zone_id, zone_name);
- int ret = zone.init(g_ceph_context, store);
+ int ret = zone.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
need_zone_update = true;
} else if (!realm_name.empty()) {
// get realm id from name
- RGWRealm realm{g_ceph_context, store};
+ RGWRealm realm{g_ceph_context, store->svc.sysobj};
ret = realm.read_id(realm_name, zone.realm_id);
if (ret < 0) {
cerr << "failed to find realm by name " << realm_name << std::endl;
}
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- ret = zonegroup.init(g_ceph_context, store);
+ ret = zonegroup.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
return EINVAL;
}
RGWZoneParams zone(zone_id,zone_name);
- int ret = zone.init(g_ceph_context, store);
+ int ret = zone.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
return -ret;
}
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- ret = zonegroup.init(g_ceph_context, store);
+ ret = zonegroup.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "WARNING: failed to initialize zonegroup " << zonegroup_name << std::endl;
} else {
}
RGWZoneParams zone(zone_id, zone_name);
- int ret = zone.init(g_ceph_context, store);
+ int ret = zone.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "failed to init zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT_ZONE_PLACEMENT_LIST:
{
RGWZoneParams zone(zone_id, zone_name);
- int ret = zone.init(g_ceph_context, store);
+ int ret = zone.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
// load the period
RGWPeriod period(period_id);
- int ret = period.init(g_ceph_context, store);
+ int ret = period.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "period init failed: " << cpp_strerror(-ret) << std::endl;
return -ret;
{
// read realm and staging period
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, store);
+ int ret = realm.init(g_ceph_context, store->svc.sysobj);
if (ret < 0) {
cerr << "Error initializing realm: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWPeriod period(RGWPeriod::get_staging_id(realm.get_id()), 1);
- ret = period.init(g_ceph_context, store, realm.get_id());
+ ret = period.init(g_ceph_context, store->svc.sysobj, realm.get_id());
if (ret < 0) {
cerr << "period init failed: " << cpp_strerror(-ret) << std::endl;
return -ret;
exit(1);
}
- int ret = store->add_bucket_placement(pool);
+ int ret = store->svc.zone->add_bucket_placement(pool);
if (ret < 0)
cerr << "failed to add bucket placement: " << cpp_strerror(-ret) << std::endl;
}
exit(1);
}
- int ret = store->remove_bucket_placement(pool);
+ int ret = store->svc.zone->remove_bucket_placement(pool);
if (ret < 0)
cerr << "failed to remove bucket placement: " << cpp_strerror(-ret) << std::endl;
}
if (opt_cmd == OPT_POOLS_LIST) {
set<rgw_pool> pools;
- int ret = store->list_placement_set(pools);
+ int ret = store->svc.zone->list_placement_set(pools);
if (ret < 0) {
cerr << "could not list placement set: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWSyncModuleInstanceRef sync_module;
- int ret = store->svc.sync_modules->get_manager()->create_instance(g_ceph_context, store->get_zone().tier_type,
- store->get_zone_params().tier_config, &sync_module);
+ int ret = store->svc.sync_modules->get_manager()->create_instance(g_ceph_context, store->svc.zone->get_zone().tier_type,
+ store->svc.zone->get_zone_params().tier_config, &sync_module);
if (ret < 0) {
lderr(cct) << "ERROR: failed to init sync module instance, ret=" << ret << dendl;
return ret;
return ret;
}
RGWPeriod period;
- ret = period.init(g_ceph_context, store, realm_id, realm_name, true);
+ ret = period.init(g_ceph_context, store->svc.sysobj, realm_id, realm_name, true);
if (ret < 0) {
cerr << "failed to init period " << ": " << cpp_strerror(-ret) << std::endl;
return ret;
}
- if (!store->is_meta_master()) {
+ if (!store->svc.zone->is_meta_master()) {
cerr << "failed to update bucket sync: only allowed on meta master zone " << std::endl;
cerr << period.get_master_zone() << " | " << period.get_realm() << std::endl;
return EINVAL;