]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: synchronize period config with period updates
authorCasey Bodley <cbodley@redhat.com>
Wed, 29 Mar 2017 18:18:38 +0000 (14:18 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 3 Apr 2017 18:42:51 +0000 (14:42 -0400)
read period config from local storage on RGWPeriod::update(), and write
the new config to storage on RGWPeriod::reflect()

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rados.cc

index bcec2bd59a7b746a807500588e4a9d105c0a41bb..15acc0cc26f8202696f791370431415cd54fd473 100644 (file)
@@ -1380,6 +1380,12 @@ int RGWPeriod::update()
     }
   }
 
+  ret = period_config.read(store, realm_id);
+  if (ret < 0 && ret != -ENOENT) {
+    ldout(cct, 0) << "ERROR: failed to read period config: "
+        << cpp_strerror(ret) << dendl;
+    return ret;
+  }
   return 0;
 }
 
@@ -1402,6 +1408,13 @@ int RGWPeriod::reflect()
       }
     }
   }
+
+  int r = period_config.write(store, realm_id);
+  if (r < 0) {
+    ldout(cct, 0) << "ERROR: failed to store period config: "
+        << cpp_strerror(-r) << dendl;
+    return r;
+  }
   return 0;
 }