return ret;
}
period.fork();
- period.update();
+ ret = period.update();
+ if(ret , 0) {
+ cerr << "failed to update period: " << cpp_strerror(-ret) << std::endl;
+ return ret;
+ }
ret = period.store_info(false);
if (ret < 0) {
cerr << "failed to store period: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
- RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name, is_master, g_ceph_context, store, realm.get_id(), endpoints);
+ RGWZoneGroup zonegroup(zonegroup_name, is_master, g_ceph_context, store, realm.get_id(), endpoints);
zonegroup.api_name = (api_name.empty() ? zonegroup_name : api_name);
ret = zonegroup.create();
if (ret < 0) {
int RGWPeriod::update()
{
+ ldout(cct, 20) << __func__ << " realm " << realm_id << " period " << get_id() << dendl;
list<string> zonegroups;
int ret = store->list_zonegroups(zonegroups);
if (ret < 0) {
}
if (zg.realm_id != realm_id) {
- ldout(cct, 20) << "skipping zonegroup " << zg.get_name() << ", not on our realm" << dendl;
+ ldout(cct, 20) << "skipping zonegroup " << zg.get_name() << " zone realm id " << zg.realm_id << ", not on our realm " << realm_id << dendl;
continue;
}
void RGWPeriod::fork()
{
+ ldout(cct, 20) << __func__ << " realm " << realm_id << " period " << id << dendl;
predecessor_uuid = id;
id = get_staging_id(realm_id);
period_map.reset();
void RGWPeriod::update(const RGWZoneGroupMap& map)
{
+ ldout(cct, 20) << __func__ << " realm " << realm_id << " period " << id << dendl;
for (std::map<string, RGWZoneGroup>::const_iterator iter = map.zonegroups.begin();
iter != map.zonegroups.end(); iter++) {
period_map.zonegroups_by_api[iter->second.api_name] = iter->second;
int RGWPeriod::commit(RGWRealm& realm, const RGWPeriod& current_period)
{
+ ldout(cct, 20) << __func__ << " realm " << realm.get_id() << " period " << current_period.get_id() << dendl;
// gateway must be in the master zone to commit
if (master_zone != store->get_zone_params().get_id()) {
lderr(cct) << "period commit sent to zone " << store->get_zone_params().get_id()
RGWZoneGroup(): is_master(false){}
RGWZoneGroup(const std::string &id, const std::string &name):RGWSystemMetaObj(id, name) {}
RGWZoneGroup(const std::string &_name):RGWSystemMetaObj(_name) {}
- RGWZoneGroup(const std::string& _id, const std::string &_name, bool _is_master, CephContext *cct, RGWRados* store,
+ RGWZoneGroup(const std::string &_name, bool _is_master, CephContext *cct, RGWRados* store,
const string& _realm_id, const list<string>& _endpoints)
: RGWSystemMetaObj(_name, cct , store), endpoints(_endpoints), is_master(_is_master),
- realm_id(_realm_id) {
- set_id(_id);
- }
+ realm_id(_realm_id) {}
bool is_master_zonegroup() const { return is_master;}
void update_master(bool _is_master) {