From: Casey Bodley Date: Tue, 8 Dec 2015 16:10:49 +0000 (-0500) Subject: rgw: start pushing current period on startup X-Git-Tag: v10.1.0~354^2~82 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b72530bc4b3a352463cfed55b2daf84c23991506;p=ceph.git rgw: start pushing current period on startup Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_period_pusher.cc b/src/rgw/rgw_period_pusher.cc index 7669631f10b..e6c87f794be 100644 --- a/src/rgw/rgw_period_pusher.cc +++ b/src/rgw/rgw_period_pusher.cc @@ -152,7 +152,23 @@ class RGWPeriodPusher::CRThread { RGWPeriodPusher::RGWPeriodPusher(RGWRados* store) : cct(store->ctx()), store(store) -{} +{ + const auto& realm = store->realm; + auto& realm_id = realm.get_id(); + if (realm_id.empty()) // no realm configuration + return; + + // always send out the current period on startup + RGWPeriod period; + int r = period.init(cct, store, realm_id, realm.get_name()); + if (r < 0) { + lderr(cct) << "failed to load period for realm " << realm_id << dendl; + return; + } + + std::lock_guard lock(mutex); + handle_notify(std::move(period)); +} // destructor is here because CRThread is incomplete in the header RGWPeriodPusher::~RGWPeriodPusher() = default;