Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osd: drop deprecated removal pg type #6970

Merged
merged 1 commit into from Dec 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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