summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@redhat.com>2016-08-27 01:43:23 +0200
committerYehuda Sadeh <yehuda@redhat.com>2016-10-07 19:31:28 +0200
commit8c030fd92424e7da91226444e87ee1d8fec2aeaf (patch)
treeea0bb2a85204d6075bbf80636f92cc69278b55ce /src
parentrgw: setting sync-from zone by name not by id (diff)
downloadceph-8c030fd92424e7da91226444e87ee1d8fec2aeaf.tar.xz
ceph-8c030fd92424e7da91226444e87ee1d8fec2aeaf.zip
rgw_admin: sync status command shows if not syncing from zone
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/rgw/rgw_admin.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc
index 60d3e81ea74..2eaf47bfd4f 100644
--- a/src/rgw/rgw_admin.cc
+++ b/src/rgw/rgw_admin.cc
@@ -1795,10 +1795,23 @@ static void get_md_sync_status(list<string>& status)
static void get_data_sync_status(const string& source_zone, list<string>& status, int tab)
{
- RGWDataSyncStatusManager sync(store, store->get_async_rados(), source_zone);
-
stringstream ss;
+ auto ziter = store->zone_by_id.find(source_zone);
+ if (ziter == store->zone_by_id.end()) {
+ 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)) {
+ push_ss(ss, status, tab) << string("not syncing from zone");
+ flush_ss(ss, status);
+ return;
+ }
+ RGWDataSyncStatusManager sync(store, store->get_async_rados(), source_zone);
+
int ret = sync.init();
if (ret < 0) {
push_ss(ss, status, tab) << string("failed to retrieve sync info: ") + cpp_strerror(-ret);