]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
RGW/standalone: fixed issues emerged when testing mulsite
authorAli Masarwa <amasarwa@redhat.com>
Tue, 8 Apr 2025 14:20:20 +0000 (17:20 +0300)
committerAli Masarwa <amasarwa@redhat.com>
Tue, 29 Apr 2025 12:31:09 +0000 (15:31 +0300)
Signed-off-by: Ali Masarwa <amasarwa@redhat.com>
src/rgw/driver/rados/rgw_rest_realm.cc
src/rgw/rgw_period_puller.cc
src/rgw/rgw_realm.cc

index 8575e466e39957536210b0acba26f243b93060c0..4a482ff86a264970c240e3ddb0858bf636f2dd49 100644 (file)
@@ -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;
index 527db45239330cee9132f36b07678d38d66bf403..862a9f3116ff621defa3de0a276220c4475f8c8c 100644 (file)
@@ -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
index 1669d72cbd4f62650466ebaa908250b415090c42..d91301e7647a0beb0bea5768553c245cd62285ab 100644 (file)
@@ -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;