From: Casey Bodley Date: Tue, 10 May 2016 19:51:27 +0000 (-0400) Subject: radosgw-admin: 'period commit' sends to new master zone by default X-Git-Tag: v10.2.1~3^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F9081%2Fhead;p=ceph.git 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 (cherry picked from commit fbe1a05355549dfe0c05750683eeb61e275950c2) --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index c54093fa6125..fd39e7535db8 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -1377,7 +1377,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(); @@ -1403,6 +1403,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("");