summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCasey Bodley <cbodley@users.noreply.github.com>2016-04-19 00:20:52 +0200
committerCasey Bodley <cbodley@users.noreply.github.com>2016-04-19 00:20:52 +0200
commitc1520fd7ab07aefe4a89f067989cbcb1353c5af8 (patch)
treea6a909d5a01ef2965999553688895c4a9ecbb272
parentMerge pull request #8645 from tchaikov/wip-fix-test.sh (diff)
parentrgw_admin: improve period update errors (diff)
downloadceph-c1520fd7ab07aefe4a89f067989cbcb1353c5af8.tar.xz
ceph-c1520fd7ab07aefe4a89f067989cbcb1353c5af8.zip
Merge pull request #8564 from theanalyst/fix/15251
rgw_admin: improve period update errors
-rw-r--r--src/rgw/rgw_admin.cc7
-rw-r--r--src/rgw/rgw_rados.cc9
-rw-r--r--src/rgw/rgw_rados.h2
3 files changed, 9 insertions, 9 deletions
diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc
index 13802bc132a..3e4bcba2790 100644
--- a/src/rgw/rgw_admin.cc
+++ b/src/rgw/rgw_admin.cc
@@ -1482,7 +1482,8 @@ static int update_period(const string& realm_id, const string& realm_name,
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);
@@ -2537,7 +2538,6 @@ int main(int argc, char **argv)
commit, remote, url, access_key, secret_key,
formatter);
if (ret < 0) {
- cerr << "period update failed: " << cpp_strerror(-ret) << std::endl;
return ret;
}
}
@@ -3799,8 +3799,7 @@ int main(int argc, char **argv)
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;
diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc
index 2bebecf0fe8..47ba96261c1 100644
--- a/src/rgw/rgw_rados.cc
+++ b/src/rgw/rgw_rados.cc
@@ -1139,7 +1139,7 @@ int RGWPeriod::add_zonegroup(const RGWZoneGroup& zonegroup)
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;
@@ -1176,9 +1176,8 @@ int RGWPeriod::update()
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;
}
}
@@ -1615,9 +1614,11 @@ void RGWPeriodMap::decode(bufferlist::iterator& bl) {
}
}
-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());
diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h
index 4c70c1d37a0..612a523570e 100644
--- a/src/rgw/rgw_rados.h
+++ b/src/rgw/rgw_rados.h
@@ -1181,7 +1181,7 @@ struct RGWPeriodMap
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);