From fbe1a05355549dfe0c05750683eeb61e275950c2 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 10 May 2016 15:51:27 -0400 Subject: [PATCH] radosgw-admin: 'period commit' sends to new master zone by default if no --remote or --url is given, set --remote = master_zone_id to override the rest_master_conn (which refers to the old master zone) Fixes: http://tracker.ceph.com/issues/15828 Signed-off-by: Casey Bodley --- src/rgw/rgw_admin.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 3efe18dc418b2..05f6f2318746f 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -1384,7 +1384,7 @@ static int send_to_remote_or_url(const string& remote, const string& url, } static int commit_period(RGWRealm& realm, RGWPeriod& period, - const string& remote, const string& url, + string remote, const string& url, const string& access, const string& secret) { const string& master_zone = period.get_master_zone(); @@ -1410,6 +1410,12 @@ static int commit_period(RGWRealm& realm, RGWPeriod& period, return ret; } + if (remote.empty() && url.empty()) { + // use the new master zone's connection + remote = master_zone; + cout << "Sending period to new master zone " << remote << std::endl; + } + // push period to the master with an empty period id period.set_id(""); -- 2.39.5