Skip to content

Commit ab76a74

Browse files
authored
Merge pull request ceph#54264 from thotz/remove_realm_name_period_config
rgw/rgw_period : remove realm name from period config Reviewed-by: Casey Bodley <cbodley@redhat.com>
2 parents 389813a + 1c579f2 commit ab76a74

File tree

8 files changed

+15
-27
lines changed

8 files changed

+15
-27
lines changed

src/rgw/driver/rados/rgw_rest_realm.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,16 @@ class RGWOp_Period_Get : public RGWOp_Period_Base {
6565

6666
void RGWOp_Period_Get::execute(optional_yield y)
6767
{
68-
string realm_id, realm_name, period_id;
68+
string realm_id, period_id;
6969
epoch_t epoch = 0;
7070
RESTArgs::get_string(s, "realm_id", realm_id, &realm_id);
71-
RESTArgs::get_string(s, "realm_name", realm_name, &realm_name);
7271
RESTArgs::get_string(s, "period_id", period_id, &period_id);
7372
RESTArgs::get_uint32(s, "epoch", 0, &epoch);
7473

7574
period.set_id(period_id);
7675
period.set_epoch(epoch);
7776

78-
op_ret = period.init(this, driver->ctx(), static_cast<rgw::sal::RadosStore*>(driver)->svc()->sysobj, realm_id, y, realm_name);
77+
op_ret = period.init(this, driver->ctx(), static_cast<rgw::sal::RadosStore*>(driver)->svc()->sysobj, realm_id, y);
7978
if (op_ret < 0)
8079
ldpp_dout(this, 5) << "failed to read period" << dendl;
8180
}

src/rgw/driver/rados/rgw_trim_mdlog.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,8 @@ bool sanity_check_endpoints(const DoutPrefixProvider *dpp, rgw::sal::RadosStore*
730730
<< __PRETTY_FUNCTION__ << ":" << __LINE__
731731
<< " WARNING: Cluster is is misconfigured! "
732732
<< " Zonegroup " << zonegroup.get_name()
733-
<< " (" << zonegroup.get_id() << ") in Realm "
734-
<< period.get_realm_name() << " ( " << period.get_realm() << ") "
733+
<< " (" << zonegroup.get_id() << ") in Realm id ( "
734+
<< period.get_realm() << ") "
735735
<< " has no endpoints!" << dendl;
736736
}
737737
for (const auto& [_, zone] : zonegroup.zones) {
@@ -741,8 +741,7 @@ bool sanity_check_endpoints(const DoutPrefixProvider *dpp, rgw::sal::RadosStore*
741741
<< " ERROR: Cluster is is misconfigured! "
742742
<< " Zone " << zone.name << " (" << zone.id << ") in Zonegroup "
743743
<< zonegroup.get_name() << " ( " << zonegroup.get_id()
744-
<< ") in Realm " << period.get_realm_name()
745-
<< " ( " << period.get_realm() << ") "
744+
<< ") in Realm id ( " << period.get_realm() << ") "
746745
<< " has no endpoints! Trimming is impossible." << dendl;
747746
retval = false;
748747
}

src/rgw/driver/rados/rgw_zone.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,6 @@ int create_realm(const DoutPrefixProvider* dpp, optional_yield y,
516516
period->period_map.id = period->id;
517517
period->epoch = FIRST_EPOCH;
518518
period->realm_id = info.id;
519-
period->realm_name = info.name;
520519

521520
r = cfgstore->create_period(dpp, y, true, *period);
522521
if (r < 0) {

src/rgw/driver/rados/rgw_zone.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,6 @@ class RGWPeriod
642642
rgw_zone_id master_zone;
643643

644644
std::string realm_id;
645-
std::string realm_name;
646645
epoch_t realm_epoch{1}; //< realm epoch when period was made current
647646

648647
CephContext *cct{nullptr};
@@ -678,7 +677,6 @@ class RGWPeriod
678677
const rgw_zone_id& get_master_zone() const { return master_zone; }
679678
const std::string& get_master_zonegroup() const { return master_zonegroup; }
680679
const std::string& get_realm() const { return realm_id; }
681-
const std::string& get_realm_name() const { return realm_name; }
682680
const RGWPeriodMap& get_map() const { return period_map; }
683681
RGWPeriodConfig& get_config() { return period_config; }
684682
const RGWPeriodConfig& get_config() const { return period_config; }
@@ -750,7 +748,7 @@ class RGWPeriod
750748
int update_latest_epoch(const DoutPrefixProvider *dpp, epoch_t epoch, optional_yield y);
751749

752750
int init(const DoutPrefixProvider *dpp, CephContext *_cct, RGWSI_SysObj *_sysobj_svc, const std::string &period_realm_id, optional_yield y,
753-
const std::string &period_realm_name = "", bool setup_obj = true);
751+
bool setup_obj = true);
754752
int init(const DoutPrefixProvider *dpp, CephContext *_cct, RGWSI_SysObj *_sysobj_svc, optional_yield y, bool setup_obj = true);
755753

756754
int create(const DoutPrefixProvider *dpp, optional_yield y, bool exclusive = true);
@@ -780,7 +778,6 @@ class RGWPeriod
780778
encode(master_zonegroup, bl);
781779
encode(period_config, bl);
782780
encode(realm_id, bl);
783-
encode(realm_name, bl);
784781
ENCODE_FINISH(bl);
785782
}
786783

@@ -796,7 +793,6 @@ class RGWPeriod
796793
decode(master_zonegroup, bl);
797794
decode(period_config, bl);
798795
decode(realm_id, bl);
799-
decode(realm_name, bl);
800796
DECODE_FINISH(bl);
801797
}
802798
void dump(Formatter *f) const;

src/rgw/rgw_period.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ int RGWPeriod::init(const DoutPrefixProvider *dpp,
2222
return 0;
2323

2424
if (id.empty()) {
25-
RGWRealm realm(realm_id, realm_name);
25+
RGWRealm realm(realm_id);
2626
int ret = realm.init(dpp, cct, sysobj_svc, y);
2727
if (ret < 0) {
28-
ldpp_dout(dpp, 4) << "RGWPeriod::init failed to init realm " << realm_name << " id " << realm_id << " : " <<
28+
ldpp_dout(dpp, 4) << "RGWPeriod::init failed to init realm id " << realm_id << " : " <<
2929
cpp_strerror(-ret) << dendl;
3030
return ret;
3131
}
@@ -36,7 +36,7 @@ int RGWPeriod::init(const DoutPrefixProvider *dpp,
3636
if (!epoch) {
3737
int ret = use_latest_epoch(dpp, y);
3838
if (ret < 0) {
39-
ldpp_dout(dpp, 0) << "failed to use_latest_epoch period id " << id << " realm " << realm_name << " id " << realm_id
39+
ldpp_dout(dpp, 0) << "failed to use_latest_epoch period id " << id << " realm id " << realm_id
4040
<< " : " << cpp_strerror(-ret) << dendl;
4141
return ret;
4242
}
@@ -46,14 +46,12 @@ int RGWPeriod::init(const DoutPrefixProvider *dpp,
4646
}
4747

4848
int RGWPeriod::init(const DoutPrefixProvider *dpp, CephContext *_cct, RGWSI_SysObj *_sysobj_svc,
49-
const string& period_realm_id, optional_yield y,
50-
const string& period_realm_name, bool setup_obj)
49+
const string& period_realm_id, optional_yield y, bool setup_obj)
5150
{
5251
cct = _cct;
5352
sysobj_svc = _sysobj_svc;
5453

5554
realm_id = period_realm_id;
56-
realm_name = period_realm_name;
5755

5856
if (!setup_obj)
5957
return 0;
@@ -244,7 +242,6 @@ void RGWPeriod::dump(Formatter *f) const
244242
encode_json("master_zone", master_zone, f);
245243
encode_json("period_config", period_config, f);
246244
encode_json("realm_id", realm_id, f);
247-
encode_json("realm_name", realm_name, f);
248245
encode_json("realm_epoch", realm_epoch, f);
249246
}
250247

@@ -259,7 +256,6 @@ void RGWPeriod::decode_json(JSONObj *obj)
259256
JSONDecoder::decode_json("master_zone", master_zone, obj);
260257
JSONDecoder::decode_json("period_config", period_config, obj);
261258
JSONDecoder::decode_json("realm_id", realm_id, obj);
262-
JSONDecoder::decode_json("realm_name", realm_name, obj);
263259
JSONDecoder::decode_json("realm_epoch", realm_epoch, obj);
264260
}
265261

src/rgw/rgw_period_pusher.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ RGWPeriodPusher::RGWPeriodPusher(const DoutPrefixProvider *dpp, rgw::sal::Driver
175175
// always send out the current period on startup
176176
RGWPeriod period;
177177
// XXX dang
178-
int r = period.init(dpp, cct, static_cast<rgw::sal::RadosStore* >(driver)->svc()->sysobj, realm_id, y, zone->get_realm_name());
178+
int r = period.init(dpp, cct, static_cast<rgw::sal::RadosStore* >(driver)->svc()->sysobj, realm_id, y);
179179
if (r < 0) {
180180
ldpp_dout(dpp, -1) << "failed to load period for realm " << realm_id << dendl;
181181
return;

src/rgw/rgw_realm.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ int RGWRealm::create(const DoutPrefixProvider *dpp, optional_yield y, bool exclu
6464
RGWPeriod period;
6565
if (current_period.empty()) {
6666
/* create new period for the realm */
67-
ret = period.init(dpp, cct, sysobj_svc, id, y, name, false);
67+
ret = period.init(dpp, cct, sysobj_svc, id, y, false);
6868
if (ret < 0 ) {
6969
return ret;
7070
}
@@ -75,7 +75,7 @@ int RGWRealm::create(const DoutPrefixProvider *dpp, optional_yield y, bool exclu
7575
}
7676
} else {
7777
period = RGWPeriod(current_period, 0);
78-
int ret = period.init(dpp, cct, sysobj_svc, id, y, name);
78+
int ret = period.init(dpp, cct, sysobj_svc, id, y);
7979
if (ret < 0) {
8080
ldpp_dout(dpp, 0) << "ERROR: failed to init period " << current_period << dendl;
8181
return ret;
@@ -228,7 +228,7 @@ int RGWRealm::find_zone(const DoutPrefixProvider *dpp,
228228
epoch_t epoch = 0;
229229

230230
RGWPeriod period(period_id, epoch);
231-
int r = period.init(dpp, cct, sysobj_svc, get_id(), y, get_name());
231+
int r = period.init(dpp, cct, sysobj_svc, get_id(), y);
232232
if (r < 0) {
233233
ldpp_dout(dpp, 0) << "WARNING: period init failed: " << cpp_strerror(-r) << " ... skipping" << dendl;
234234
return r;

src/rgw/services/svc_zone.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ int RGWSI_Zone::do_start(optional_yield y, const DoutPrefixProvider *dpp)
146146
}
147147

148148
ldpp_dout(dpp, 20) << "realm " << realm->get_name() << " " << realm->get_id() << dendl;
149-
ret = current_period->init(dpp, cct, sysobj_svc, realm->get_id(), y,
150-
realm->get_name());
149+
ret = current_period->init(dpp, cct, sysobj_svc, realm->get_id(), y);
151150
if (ret < 0 && ret != -ENOENT) {
152151
ldpp_dout(dpp, 0) << "failed reading current period info: " << " " << cpp_strerror(-ret) << dendl;
153152
return ret;

0 commit comments

Comments
 (0)