From b49b06534345ea5ebba5917ee32395693763aa32 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 29 Mar 2017 14:18:38 -0400 Subject: [PATCH] rgw: synchronize period config with period updates read period config from local storage on RGWPeriod::update(), and write the new config to storage on RGWPeriod::reflect() Signed-off-by: Casey Bodley --- src/rgw/rgw_rados.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index bcec2bd59a7..15acc0cc26f 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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; } -- 2.39.5