]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix RGWZoneGroup ctor and check period update return code
authorOrit Wasserman <owasserm@redhat.com>
Fri, 8 Jan 2016 09:13:09 +0000 (10:13 +0100)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:50 +0000 (16:13 -0800)
Add more debug messages

Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_admin.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 3c4d20ad3c5026dc77354ffd4ea2b82325e6ec57..4e2d4dcc54ac84c7699aaca6146561851f20777b 100644 (file)
@@ -1457,7 +1457,11 @@ static int update_period(const string& realm_id, const string& realm_name,
     return ret;
   }
   period.fork();
-  period.update();
+  ret = period.update();
+  if(ret , 0) {
+    cerr << "failed to update period: " << cpp_strerror(-ret) << std::endl;
+    return ret;
+  }
   ret = period.store_info(false);
   if (ret < 0) {
     cerr << "failed to store period: " << cpp_strerror(-ret) << std::endl;
@@ -2470,7 +2474,7 @@ int main(int argc, char **argv)
          return -ret;
        }
 
-       RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name, is_master, g_ceph_context, store, realm.get_id(), endpoints);
+       RGWZoneGroup zonegroup(zonegroup_name, is_master, g_ceph_context, store, realm.get_id(), endpoints);
         zonegroup.api_name = (api_name.empty() ? zonegroup_name : api_name);
        ret = zonegroup.create();
        if (ret < 0) {
index fc6340923fb37b2dac03a60dece082e9c5507d6c..72abdd937be386e7c24049b4b2aaf6dc45f7c463 100644 (file)
@@ -1162,6 +1162,7 @@ int RGWPeriod::add_zonegroup(const RGWZoneGroup& zonegroup)
 
 int RGWPeriod::update()
 {
+  ldout(cct, 20) << __func__ << " realm " << realm_id << " period " << get_id() << dendl;
   list<string> zonegroups;
   int ret = store->list_zonegroups(zonegroups);
   if (ret < 0) {
@@ -1178,7 +1179,7 @@ int RGWPeriod::update()
     }
 
     if (zg.realm_id != realm_id) {
-      ldout(cct, 20) << "skipping zonegroup " << zg.get_name() << ", not on our realm" << dendl;
+      ldout(cct, 20) << "skipping zonegroup " << zg.get_name() << " zone realm id " << zg.realm_id << ", not on our realm " << realm_id << dendl;
       continue;
     }
     
@@ -1213,6 +1214,7 @@ int RGWPeriod::reflect()
 
 void RGWPeriod::fork()
 {
+  ldout(cct, 20) << __func__ << " realm " << realm_id << " period " << id << dendl;
   predecessor_uuid = id;
   id = get_staging_id(realm_id);
   period_map.reset();
@@ -1220,6 +1222,7 @@ void RGWPeriod::fork()
 
 void RGWPeriod::update(const RGWZoneGroupMap& map)
 {
+  ldout(cct, 20) << __func__ << " realm " << realm_id << " period " << id << dendl;
   for (std::map<string, RGWZoneGroup>::const_iterator iter = map.zonegroups.begin();
        iter != map.zonegroups.end(); iter++) {
     period_map.zonegroups_by_api[iter->second.api_name] = iter->second;
@@ -1266,6 +1269,7 @@ int RGWPeriod::update_sync_status()
 
 int RGWPeriod::commit(RGWRealm& realm, const RGWPeriod& current_period)
 {
+  ldout(cct, 20) << __func__ << " realm " << realm.get_id() << " period " << current_period.get_id() << dendl;
   // gateway must be in the master zone to commit
   if (master_zone != store->get_zone_params().get_id()) {
     lderr(cct) << "period commit sent to zone " << store->get_zone_params().get_id()
index d2f790d278f4b833e2023d3eb91b915d1aad7991..8f199b737b39a6590590c2858b1b7e22ee270885 100644 (file)
@@ -1084,12 +1084,10 @@ struct RGWZoneGroup : public RGWSystemMetaObj {
   RGWZoneGroup(): is_master(false){}
   RGWZoneGroup(const std::string &id, const std::string &name):RGWSystemMetaObj(id, name) {}
   RGWZoneGroup(const std::string &_name):RGWSystemMetaObj(_name) {}
-  RGWZoneGroup(const std::string& _id, const std::string &_name, bool _is_master, CephContext *cct, RGWRados* store,
+  RGWZoneGroup(const std::string &_name, bool _is_master, CephContext *cct, RGWRados* store,
               const string& _realm_id, const list<string>& _endpoints)
     : RGWSystemMetaObj(_name, cct , store), endpoints(_endpoints), is_master(_is_master),
-      realm_id(_realm_id) {
-    set_id(_id);
-  }
+      realm_id(_realm_id) {}
 
   bool is_master_zonegroup() const { return is_master;}
   void update_master(bool _is_master) {