From 6c6f78bcc070315f36414df0a24cead12d11b573 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 29 Mar 2017 14:20:47 -0400 Subject: [PATCH] rgw: load period config separately when there's no current period Signed-off-by: Casey Bodley --- src/rgw/rgw_rados.cc | 8 ++++++++ src/rgw/rgw_rados.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 15acc0cc26f82..ff354d5ba3b4a 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -3985,6 +3985,14 @@ int RGWRados::init_complete() if (ret < 0) { return ret; } + // read period_config into current_period + auto& period_config = current_period.get_config(); + ret = period_config.read(this, zonegroup.realm_id); + if (ret < 0 && ret != -ENOENT) { + ldout(cct, 0) << "ERROR: failed to read period config: " + << cpp_strerror(ret) << dendl; + return ret; + } } ldout(cct, 10) << "Cannot find current period zone using local zone" << dendl; diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index a39cc94d6cd96..4a4f75c2bb537 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -1797,6 +1797,7 @@ public: const string& get_master_zonegroup() const { return master_zonegroup; } const string& get_realm() const { return realm_id; } const RGWPeriodMap& get_map() const { return period_map; } + RGWPeriodConfig& get_config() { return period_config; } const RGWPeriodConfig& get_config() const { return period_config; } const std::vector& get_sync_status() const { return sync_status; } rgw_pool get_pool(CephContext *cct); -- 2.39.5