]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add RGWRealm::notify_new_period()
authorCasey Bodley <cbodley@redhat.com>
Fri, 30 Oct 2015 20:37:43 +0000 (16:37 -0400)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:34 +0000 (16:13 -0800)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_admin.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h
src/rgw/rgw_rest_realm.cc

index 395cece766bcedc86f460f393f3609c57ddb22a8..85d1532eb5bbc29ba34e9c5dd76aedbdacd23b93 100644 (file)
@@ -1412,7 +1412,7 @@ static int commit_period(RGWRealm& realm, RGWPeriod& period,
     cerr << "Error updating period epoch: " << cpp_strerror(ret) << std::endl;
     return ret;
   }
-  realm.notify_zone();
+  realm.notify_new_period(period);
   return ret;
 }
 
index 162be7ae8cd7d3367c05bcc7138bdcbc89598be7..c997e892a4ae33af70042fb83679028076533e44 100644 (file)
@@ -792,6 +792,10 @@ int RGWRealm::notify_zone()
   return 0;
 }
 
+int RGWRealm::notify_new_period(const RGWPeriod& period)
+{
+  return notify_zone();
+}
 
 int RGWPeriod::init(CephContext *_cct, RGWRados *_store, const string& period_realm_id,
                    const string& period_realm_name, bool setup_obj)
@@ -1209,7 +1213,7 @@ int RGWPeriod::commit(RGWRealm& realm, const RGWPeriod& current_period)
     }
     ldout(cct, 4) << "Promoted to master zone and committed new period "
         << id << dendl;
-    realm.notify_zone();
+    realm.notify_new_period(*this);
     return 0;
   }
   // period must be based on predecessor's current epoch
@@ -1236,7 +1240,7 @@ int RGWPeriod::commit(RGWRealm& realm, const RGWPeriod& current_period)
   }
   ldout(cct, 4) << "Committed new epoch " << epoch
       << " for period " << id << dendl;
-  realm.notify_zone();
+  realm.notify_new_period(*this);
   return 0;
 }
 
index d26fabef445885893e9ff8562365604af509dc2f..b2f914722d6b2b2ff7a6a55b063153475e94f96a 100644 (file)
@@ -1273,6 +1273,8 @@ struct objexp_hint_entry {
 };
 WRITE_CLASS_ENCODER(objexp_hint_entry)
 
+class RGWPeriod;
+
 class RGWRealm : public RGWSystemMetaObj
 {
   string master_zonegroup;
@@ -1322,7 +1324,10 @@ public:
   int set_current_period(const string& period_id);
 
   string get_control_oid();
+  /// send a notify on the realm control object
   int notify_zone();
+  /// notify the zone of a new period
+  int notify_new_period(const RGWPeriod& period);
 };
 WRITE_CLASS_ENCODER(RGWRealm)
 
index bc51d14804a4428fccf05cbcc0f5d64f159470ba..e988ca991da69f2e9bb5fe96eb27d9e64f51622f 100644 (file)
@@ -148,7 +148,7 @@ void RGWOp_Period_Post::execute()
     ldout(cct, 4) << "current period " << current_period.get_id()
         << " is period " << period.get_id() << "'s predecessor, "
         "updating current period and notifying zone" << dendl;
-    realm.notify_zone();
+    realm.notify_new_period(period);
     return;
   }
 
@@ -175,7 +175,7 @@ void RGWOp_Period_Post::execute()
   ldout(cct, 4) << "period epoch " << period.get_epoch()
       << " is newer than current epoch " << current_period.get_epoch()
       << ", updating latest epoch and notifying zone" << dendl;
-  realm.notify_zone();
+  realm.notify_new_period(period);
 }
 
 class RGWHandler_Period : public RGWHandler_Auth_S3 {