]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: 'period commit' sends to new master zone by default 9081/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 10 May 2016 19:51:27 +0000 (15:51 -0400)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 10 May 2016 21:18:40 +0000 (14:18 -0700)
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 <cbodley@redhat.com>
(cherry picked from commit fbe1a05355549dfe0c05750683eeb61e275950c2)

src/rgw/rgw_admin.cc

index c54093fa612597926f901aebf60d705cb4000b24..fd39e7535db81fc09d077612f886d958ffd3215f 100644 (file)
@@ -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("");