From 9342ae64976ff13d08f75c53bac68107f29c9843 Mon Sep 17 00:00:00 2001 From: Ali Masarwa Date: Tue, 8 Apr 2025 17:20:20 +0300 Subject: [PATCH] RGW/standalone: fixed issues emerged when testing mulsite Signed-off-by: Ali Masarwa --- src/rgw/driver/rados/rgw_rest_realm.cc | 10 ++-------- src/rgw/rgw_period_puller.cc | 4 +--- src/rgw/rgw_realm.cc | 7 ++----- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/rgw/driver/rados/rgw_rest_realm.cc b/src/rgw/driver/rados/rgw_rest_realm.cc index 8575e466e3995..4a482ff86a264 100644 --- a/src/rgw/driver/rados/rgw_rest_realm.cc +++ b/src/rgw/driver/rados/rgw_rest_realm.cc @@ -74,13 +74,7 @@ void RGWOp_Period_Get::execute(optional_yield y) RESTArgs::get_string(s, "period_id", period_id, &period_id); RESTArgs::get_uint32(s, "epoch", 0, &epoch); - - period.set_realm_id(realm_id); - period.set_id(period_id); - period.set_epoch(epoch); - - - op_ret = s->penv.cfgstore->read_period(this, y, period_id, epoch, period); + op_ret = s->penv.cfgstore->read_period(this, y, period_id, std::nullopt, period); if (op_ret < 0) ldpp_dout(this, 5) << "failed to read period" << dendl; } @@ -107,7 +101,7 @@ void RGWOp_Period_Post::execute(optional_yield y) auto cct = driver->ctx(); // initialize the period without reading from rados - s->penv.cfgstore->read_period(this, y,driver->get_zone()->get_current_period_id(), std::nullopt, period); + s->penv.cfgstore->read_period(this, y, driver->get_zone()->get_current_period_id(), std::nullopt, period); // decode the period from input const auto max_size = cct->_conf->rgw_max_put_param_size; diff --git a/src/rgw/rgw_period_puller.cc b/src/rgw/rgw_period_puller.cc index 527db45239330..862a9f3116ff6 100644 --- a/src/rgw/rgw_period_puller.cc +++ b/src/rgw/rgw_period_puller.cc @@ -70,10 +70,8 @@ int RGWPeriodPuller::pull(const DoutPrefixProvider *dpp, const std::string& peri optional_yield y, rgw::sal::ConfigStore* cfgstore) { // try to read the period from rados - constexpr auto zero_epoch = 0; period.set_id(period_id); - period.set_epoch(zero_epoch); - int r = cfgstore->read_period(dpp, y, period_id, zero_epoch, period); + int r = cfgstore->read_period(dpp, y, period_id, std::nullopt, period); if (r < 0) { if (svc.zone->is_meta_master()) { // can't pull if we're the master diff --git a/src/rgw/rgw_realm.cc b/src/rgw/rgw_realm.cc index 1669d72cbd4f6..d91301e7647a0 100644 --- a/src/rgw/rgw_realm.cc +++ b/src/rgw/rgw_realm.cc @@ -69,11 +69,8 @@ int RGWRealm::find_zone(const DoutPrefixProvider *dpp, found = false; - string period_id; - epoch_t epoch = 0; - - RGWPeriod period(period_id, epoch); - int r = cfgstore->read_period(dpp, y, period_id, epoch, period); + RGWPeriod period; + int r = cfgstore->read_period(dpp, y, current_period, std::nullopt, period); if (r < 0) { ldpp_dout(dpp, 0) << "WARNING: period init failed: " << cpp_strerror(-r) << " ... skipping" << dendl; return r; -- 2.39.5