From: Casey Bodley Date: Thu, 17 Dec 2015 21:02:53 +0000 (-0500) Subject: rgw: add period history and puller to RGWRados X-Git-Tag: v10.1.0~354^2~73 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f420bd2af825847e74717aec2af6d5d4247bc1b0;p=ceph.git rgw: add period history and puller to RGWRados Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 7f221e41e9a..e545a65cf69 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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) { diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index e559b7fbda2..03271071dbd 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -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 period_puller; + // maintains a connected history of periods + std::unique_ptr period_history; + RGWMetadataManager *meta_mgr; RGWDataChangesLog *data_log;