period.fork();
ret = period.update();
if(ret < 0) {
- cerr << "failed to update period: " << cpp_strerror(-ret) << std::endl;
+ // Dropping the error message here, as both the ret codes were handled in
+ // period.update()
return ret;
}
ret = period.store_info(false);
commit, remote, url, access_key, secret_key,
formatter);
if (ret < 0) {
- cerr << "period update failed: " << cpp_strerror(-ret) << std::endl;
return ret;
}
}
commit, remote, url, access_key, secret_key,
formatter);
if (ret < 0) {
- cerr << "period update failed: " << cpp_strerror(-ret) << std::endl;
- return ret;
+ return ret;
}
}
return 0;
if (zonegroup.realm_id != realm_id) {
return 0;
}
- int ret = period_map.update(zonegroup);
+ int ret = period_map.update(zonegroup, cct);
if (ret < 0) {
ldout(cct, 0) << "ERROR: updating period map: " << cpp_strerror(-ret) << dendl;
return ret;
master_zone = zg.master_zone;
}
- int ret = period_map.update(zg);
+ int ret = period_map.update(zg, cct);
if (ret < 0) {
- ldout(cct, 0) << "ERROR: updating period map: " << cpp_strerror(-ret) << dendl;
return ret;
}
}
}
}
-int RGWPeriodMap::update(const RGWZoneGroup& zonegroup)
+int RGWPeriodMap::update(const RGWZoneGroup& zonegroup, CephContext *cct)
{
if (zonegroup.is_master && (!master_zonegroup.empty() && zonegroup.get_id() != master_zonegroup)) {
+ ldout(cct,0) << "Error updating periodmap, multiple master zonegroups configured "<< dendl;
+ ldout(cct,0) << "master zonegroup: " << master_zonegroup << " and " << zonegroup.get_id() <<dendl;
return -EINVAL;
}
map<string, RGWZoneGroup>::iterator iter = zonegroups.find(zonegroup.get_id());
void encode(bufferlist& bl) const;
void decode(bufferlist::iterator& bl);
- int update(const RGWZoneGroup& zonegroup);
+ int update(const RGWZoneGroup& zonegroup, CephContext *cct);
void dump(Formatter *f) const;
void decode_json(JSONObj *obj);