]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: load period config separately when there's no current period
authorCasey Bodley <cbodley@redhat.com>
Wed, 29 Mar 2017 18:20:47 +0000 (14:20 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 3 Apr 2017 18:42:51 +0000 (14:42 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 15acc0cc26f8202696f791370431415cd54fd473..ff354d5ba3b4a48c0b01912d312aa56764b4930d 100644 (file)
@@ -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;
index a39cc94d6cd96469b3088832cb658225779078f5..4a4f75c2bb537b3e8ad7449956e2947772b90bf2 100644 (file)
@@ -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<std::string>& get_sync_status() const { return sync_status; }
   rgw_pool get_pool(CephContext *cct);