FORREMOVAL_ pg type is deprecated and can be removed.
Signed-off-by: Igor Podoski <igor.podoski@ts.fujitsu.com>
-Subproject commit 67383cc060dd9f90d398eed5a00e31eb70845dd8
+Subproject commit 47fbf8c6ae1fb4fca171ac86e98821a67fd32031
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;
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");
}
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);
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");
}
// ---
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;
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;
}
}
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);
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;