]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add period history and puller to RGWRados
authorCasey Bodley <cbodley@redhat.com>
Thu, 17 Dec 2015 21:02:53 +0000 (16:02 -0500)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:52 +0000 (16:13 -0800)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 7f221e41e9a5b86d1c4973816fddb4a09dc9f90d..e545a65cf69958b84ec052b1824bcb9dcdb713bd 100644 (file)
@@ -1267,7 +1267,7 @@ 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()
+    lderr(cct) << "period commit on zone " << store->get_zone_params().get_id()
         << ", not period's master zone " << master_zone << dendl;
     return -EINVAL;
   }
@@ -1312,7 +1312,7 @@ int RGWPeriod::commit(RGWRealm& realm, const RGWPeriod& current_period)
     realm.notify_new_period(*this);
     return 0;
   }
-  // period must be based on predecessor's current epoch
+  // period must be based on current epoch
   if (epoch != current_period.get_epoch()) {
     lderr(cct) << "period epoch " << epoch << " does not match "
         "predecessor epoch " << current_period.get_epoch() << dendl;
@@ -3592,6 +3592,10 @@ int RGWRados::init_complete()
   finisher = new Finisher(cct);
   finisher->start();
 
+  period_puller.reset(new RGWPeriodPuller(this));
+  period_history.reset(new RGWPeriodHistory(cct, period_puller.get(),
+                                            current_period));
+
   if (need_watch_notify()) {
     ret = init_watch();
     if (ret < 0) {
index e559b7fbda2081ac620ba667a2c1209d2c9c1087..03271071dbd2fb682558ee797e01293cf089799e 100644 (file)
@@ -17,6 +17,7 @@
 #include "rgw_log.h"
 #include "rgw_metadata.h"
 #include "rgw_meta_sync_status.h"
+#include "rgw_period_puller.h"
 
 class RGWWatcher;
 class SafeTimer;
@@ -1904,6 +1905,11 @@ public:
     return current_period.get_config().user_quota;
   }
 
+  // pulls missing periods for period_history
+  std::unique_ptr<RGWPeriodPuller> period_puller;
+  // maintains a connected history of periods
+  std::unique_ptr<RGWPeriodHistory> period_history;
+
   RGWMetadataManager *meta_mgr;
 
   RGWDataChangesLog *data_log;