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/OSDMap: ignore PGs from pools of failure-domain OSD #20703

Merged
merged 1 commit into from Mar 8, 2018
Merged
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
30 changes: 28 additions & 2 deletions src/osd/OSDMap.cc
Expand Up @@ -1638,6 +1638,11 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
lderr(cct) << __func__ << " unable to load failure-domain-type of pg "
<< p.first << dendl;
continue;
} else if (type == 0) {
ldout(cct, 10) << __func__ << " failure-domain of pg " << p.first
<< " is osd-level, skipping"
<< dendl;
continue;
}
ldout(cct, 10) << __func__ << " pg " << p.first
<< " crush-rule-id " << crush_rule
Expand All @@ -1647,16 +1652,24 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
int primary;
tmpmap.pg_to_raw_up(p.first, &raw, &primary);
set<int> parents;
bool error = false;
bool collide = false;
for (auto osd : raw) {
auto parent = tmpmap.crush->get_parent_of_type(osd, type);
if (parent >= 0) {
lderr(cct) << __func__ << " unable to get parent of raw osd." << osd
<< ", pg " << p.first
<< dendl;
error = true;
break;
}
auto r = parents.insert(parent);
if (!r.second) {
collide = true;
break;
}
}
if (collide) {
if (!error && collide) {
ldout(cct, 10) << __func__ << " removing invalid pg_upmap "
<< "[" << p.first << ":" << p.second << "]"
<< ", final mapping result will be: " << raw
Expand Down Expand Up @@ -1685,6 +1698,11 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
lderr(cct) << __func__ << " unable to load failure-domain-type of pg "
<< p.first << dendl;
continue;
} else if (type == 0) {
ldout(cct, 10) << __func__ << " failure-domain of pg " << p.first
<< " is osd-level, skipping"
<< dendl;
continue;
}
ldout(cct, 10) << __func__ << " pg " << p.first
<< " crush_rule_id " << crush_rule
Expand All @@ -1694,16 +1712,24 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
int primary;
tmpmap.pg_to_raw_up(p.first, &raw, &primary);
set<int> parents;
bool error = false;
bool collide = false;
for (auto osd : raw) {
auto parent = tmpmap.crush->get_parent_of_type(osd, type);
if (parent >= 0) {
lderr(cct) << __func__ << " unable to get parent of raw osd." << osd
<< ", pg " << p.first
<< dendl;
error = true;
break;
}
auto r = parents.insert(parent);
if (!r.second) {
collide = true;
break;
}
}
if (collide) {
if (!error && collide) {
ldout(cct, 10) << __func__ << " removing invalid pg_upmap_items "
<< "[" << p.first << ":" << p.second << "]"
<< ", final mapping result will be: " << raw
Expand Down