Skip to content

Commit 9342ae6

Browse files
committed
RGW/standalone: fixed issues emerged when testing mulsite
Signed-off-by: Ali Masarwa <[email protected]>
1 parent f2bdd9a commit 9342ae6

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

src/rgw/driver/rados/rgw_rest_realm.cc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,7 @@ void RGWOp_Period_Get::execute(optional_yield y)
7474
RESTArgs::get_string(s, "period_id", period_id, &period_id);
7575
RESTArgs::get_uint32(s, "epoch", 0, &epoch);
7676

77-
78-
period.set_realm_id(realm_id);
79-
period.set_id(period_id);
80-
period.set_epoch(epoch);
81-
82-
83-
op_ret = s->penv.cfgstore->read_period(this, y, period_id, epoch, period);
77+
op_ret = s->penv.cfgstore->read_period(this, y, period_id, std::nullopt, period);
8478
if (op_ret < 0)
8579
ldpp_dout(this, 5) << "failed to read period" << dendl;
8680
}
@@ -107,7 +101,7 @@ void RGWOp_Period_Post::execute(optional_yield y)
107101
auto cct = driver->ctx();
108102

109103
// initialize the period without reading from rados
110-
s->penv.cfgstore->read_period(this, y,driver->get_zone()->get_current_period_id(), std::nullopt, period);
104+
s->penv.cfgstore->read_period(this, y, driver->get_zone()->get_current_period_id(), std::nullopt, period);
111105

112106
// decode the period from input
113107
const auto max_size = cct->_conf->rgw_max_put_param_size;

src/rgw/rgw_period_puller.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ int RGWPeriodPuller::pull(const DoutPrefixProvider *dpp, const std::string& peri
7070
optional_yield y, rgw::sal::ConfigStore* cfgstore)
7171
{
7272
// try to read the period from rados
73-
constexpr auto zero_epoch = 0;
7473
period.set_id(period_id);
75-
period.set_epoch(zero_epoch);
76-
int r = cfgstore->read_period(dpp, y, period_id, zero_epoch, period);
74+
int r = cfgstore->read_period(dpp, y, period_id, std::nullopt, period);
7775
if (r < 0) {
7876
if (svc.zone->is_meta_master()) {
7977
// can't pull if we're the master

src/rgw/rgw_realm.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,8 @@ int RGWRealm::find_zone(const DoutPrefixProvider *dpp,
6969

7070
found = false;
7171

72-
string period_id;
73-
epoch_t epoch = 0;
74-
75-
RGWPeriod period(period_id, epoch);
76-
int r = cfgstore->read_period(dpp, y, period_id, epoch, period);
72+
RGWPeriod period;
73+
int r = cfgstore->read_period(dpp, y, current_period, std::nullopt, period);
7774
if (r < 0) {
7875
ldpp_dout(dpp, 0) << "WARNING: period init failed: " << cpp_strerror(-r) << " ... skipping" << dendl;
7976
return r;

0 commit comments

Comments
 (0)