From f420bd2af825847e74717aec2af6d5d4247bc1b0 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 17 Dec 2015 16:02:53 -0500 Subject: [PATCH] rgw: add period history and puller to RGWRados Signed-off-by: Casey Bodley --- src/rgw/rgw_rados.cc | 8 ++++++-- src/rgw/rgw_rados.h | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 7f221e41e9a5b..e545a65cf6995 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 e559b7fbda208..03271071dbd2f 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; -- 2.39.5