]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: update rest_conn_master when adding a new master zonegroup
authorOrit Wasserman <owasserm@redhat.com>
Wed, 14 Oct 2015 15:12:56 +0000 (17:12 +0200)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:11 +0000 (16:13 -0800)
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_rados.cc
src/rgw/rgw_rest_conn.cc
src/rgw/rgw_rest_conn.h

index ddce9d660b9e376c513ae5ae8d4f67a655501e78..ae7c7fc9e28ce87ecea58e2ad46c688d7002c1c3 100644 (file)
@@ -1188,6 +1188,14 @@ int RGWZoneGroupMap::update(CephContext *cct, RGWRados *store,
     return ret;
   }
 
+  /* update rest_master_conn if not already created*/
+  if (zonegroup.is_master) {
+    if (!store->rest_master_conn) {
+      store->rest_master_conn = new RGWRESTConn(cct, store, zonegroup.endpoints);
+      derr << "creating rest_master_conn  " << dendl;
+    }
+  }
+
   RGWPeriod period(realm.get_current_period());
   ret = period.init(cct, store, realm.get_id());
   if (ret < 0) {
index 24c0b86ea7eab6a9e4210b9486cec24fc5b70892..65fd9d01731e9afd5c82c9a07dd53a562b90d5f2 100644 (file)
@@ -6,9 +6,9 @@
 
 #define dout_subsys ceph_subsys_rgw
 
-RGWRESTConn::RGWRESTConn(CephContext *_cct, RGWRados *store, list<string>& remote_endpoints) : cct(_cct)
+RGWRESTConn::RGWRESTConn(CephContext *_cct, RGWRados *store, const list<string>& remote_endpoints) : cct(_cct)
 {
-  list<string>::iterator iter;
+  list<string>::const_iterator iter;
   int i;
   for (i = 0, iter = remote_endpoints.begin(); iter != remote_endpoints.end(); ++iter, ++i) {
     endpoints[i] = *iter;
index d80dfe7869f6c85e14ddabb4bd8952c17287e4a4..c6de48abf0654cae21404c49bf91f8be3c1436ce 100644 (file)
@@ -46,7 +46,7 @@ class RGWRESTConn
 
 public:
 
-  RGWRESTConn(CephContext *_cct, RGWRados *store, list<string>& endpoints);
+  RGWRESTConn(CephContext *_cct, RGWRados *store, const list<string>& endpoints);
   int get_url(string& endpoint);
   string get_url();
   const string& get_zonegroup() {