Skip to content

Commit

Permalink
Drop deprecated removal pg typea.
Browse files Browse the repository at this point in the history
FORREMOVAL_ pg type is deprecated and can be removed.

Signed-off-by: Igor Podoski <igor.podoski@ts.fujitsu.com>
  • Loading branch information
Igor Podoski committed Dec 18, 2015
1 parent 14df4b0 commit 46c442a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 42 deletions.
4 changes: 2 additions & 2 deletions src/osd/OSD.cc
Expand Up @@ -2847,8 +2847,8 @@ void OSD::load_pgs()
it != ls.end();
++it) {
spg_t pgid;
if (it->is_temp(&pgid) || it->is_removal(&pgid) ||
(it->is_pg(&pgid) && PG::_has_removal_flag(store, pgid))) {
if (it->is_temp(&pgid) ||
(it->is_pg(&pgid) && PG::_has_removal_flag(store, pgid))) {
dout(10) << "load_pgs " << *it << " clearing temp" << dendl;
recursive_remove_collection(store, pgid, *it);
continue;
Expand Down
26 changes: 1 addition & 25 deletions src/osd/osd_types.cc
Expand Up @@ -562,11 +562,6 @@ void coll_t::calc_str()
case TYPE_PG_TEMP:
_str = stringify(pgid) + "_TEMP";
break;
case TYPE_PG_REMOVAL:
_str = string("FORREMOVAL_") +
stringify(removal_seq) + "_" +
stringify(pgid);
break;
default:
assert(0 == "unknown collection type");
}
Expand Down Expand Up @@ -598,29 +593,12 @@ bool coll_t::parse(const std::string& s)
assert(s == _str);
return true;
}
if (s.find("FORREMOVAL_") == 0) {
type = TYPE_PG_REMOVAL;
stringstream ss(s.substr(11));
ss >> removal_seq;
char sep;
ss >> sep;
assert(sep == '_');
string pgid_str;
ss >> pgid_str;
if (!pgid.parse(pgid_str.c_str())) {
assert(0);
return false;
}
calc_str();
assert(s == _str);
return true;
}
return false;
}

void coll_t::encode(bufferlist& bl) const
{
if (is_removal() || is_temp()) {
if (is_temp()) {
// can't express this as v2...
__u8 struct_v = 3;
::encode(struct_v, bl);
Expand Down Expand Up @@ -704,8 +682,6 @@ void coll_t::generate_test_instances(list<coll_t*>& o)
o.push_back(new coll_t(spg_t(pg_t(3, 2), shard_id_t(12))));
o.push_back(new coll_t(o.back()->get_temp()));
o.push_back(new coll_t());
o.back()->parse("FORREMOVAL_0_0.1");
o.back()->parse("FORREMOVAL_123_2.2a3f");
}

// ---
Expand Down
13 changes: 1 addition & 12 deletions src/osd/osd_types.h
Expand Up @@ -506,7 +506,6 @@ class coll_t {
TYPE_LEGACY_TEMP = 1, /* no longer used */
TYPE_PG = 2,
TYPE_PG_TEMP = 3,
TYPE_PG_REMOVAL = 4, /* note: deprecated, not encoded */
};
type_t type;
spg_t pgid;
Expand Down Expand Up @@ -563,7 +562,7 @@ class coll_t {
return type == TYPE_META;
}
bool is_pg_prefix(spg_t *pgid_) const {
if (type == TYPE_PG || type == TYPE_PG_TEMP || type == TYPE_PG_REMOVAL) {
if (type == TYPE_PG || type == TYPE_PG_TEMP) {
*pgid_ = pgid;
return true;
}
Expand All @@ -589,16 +588,6 @@ class coll_t {
}
return false;
}
bool is_removal() const {
return type == TYPE_PG_REMOVAL;
}
bool is_removal(spg_t *pgid_) const {
if (type == TYPE_PG_REMOVAL) {
*pgid_ = pgid;
return true;
}
return false;
}

void encode(bufferlist& bl) const;
void decode(bufferlist::iterator& bl);
Expand Down
3 changes: 1 addition & 2 deletions src/tools/ceph_objectstore_tool.cc
Expand Up @@ -459,8 +459,7 @@ int finish_remove_pgs(ObjectStore *store)
spg_t pgid;

if (it->is_temp(&pgid) ||
it->is_removal(&pgid) ||
(it->is_pg(&pgid) && PG::_has_removal_flag(store, pgid))) {
(it->is_pg(&pgid) && PG::_has_removal_flag(store, pgid))) {
cout << "finish_remove_pgs " << *it << " removing " << pgid << std::endl;
OSD::recursive_remove_collection(store, pgid, *it);
continue;
Expand Down

0 comments on commit 46c442a

Please sign in to comment.