void OSDMap::clean_temps(CephContext *cct,
const OSDMap& oldmap,
- const OSDMap& tmpmap,
+ const OSDMap& nextmap,
Incremental *pending_inc)
{
ldout(cct, 10) << __func__ << dendl;
- for (auto pg : *tmpmap.pg_temp) {
+ for (auto pg : *nextmap.pg_temp) {
// if pool does not exist, remove any existing pg_temps associated with
// it. we don't care about pg_temps on the pending_inc either; if there
// are new_pg_temp entries on the pending, clear them out just as well.
- if (!tmpmap.have_pg_pool(pg.first.pool())) {
+ if (!nextmap.have_pg_pool(pg.first.pool())) {
ldout(cct, 10) << __func__ << " removing pg_temp " << pg.first
<< " for nonexistent pool " << pg.first.pool() << dendl;
pending_inc->new_pg_temp[pg.first].clear();
// all osds down?
unsigned num_up = 0;
for (auto o : pg.second) {
- if (!tmpmap.is_down(o)) {
+ if (!nextmap.is_down(o)) {
++num_up;
break;
}
// redundant pg_temp?
vector<int> raw_up;
int primary;
- tmpmap.pg_to_raw_up(pg.first, &raw_up, &primary);
+ nextmap.pg_to_raw_up(pg.first, &raw_up, &primary);
bool remove = false;
if (raw_up == pg.second) {
ldout(cct, 10) << __func__ << " removing pg_temp " << pg.first << " "
remove = true;
}
// oversized pg_temp?
- if (pg.second.size() > tmpmap.get_pg_pool(pg.first.pool())->get_size()) {
+ if (pg.second.size() > nextmap.get_pg_pool(pg.first.pool())->get_size()) {
ldout(cct, 10) << __func__ << " removing pg_temp " << pg.first << " "
<< pg.second << " exceeds pool size" << dendl;
remove = true;
}
}
- for (auto &pg : *tmpmap.primary_temp) {
+ for (auto &pg : *nextmap.primary_temp) {
// primary down?
- if (tmpmap.is_down(pg.second)) {
+ if (nextmap.is_down(pg.second)) {
ldout(cct, 10) << __func__ << " removing primary_temp " << pg.first
<< " to down " << pg.second << dendl;
pending_inc->new_primary_temp[pg.first] = -1;
vector<int> real_up, templess_up;
int real_primary, templess_primary;
pg_t pgid = pg.first;
- tmpmap.pg_to_acting_osds(pgid, &real_up, &real_primary);
- tmpmap.pg_to_raw_up(pgid, &templess_up, &templess_primary);
+ nextmap.pg_to_acting_osds(pgid, &real_up, &real_primary);
+ nextmap.pg_to_raw_up(pgid, &templess_up, &templess_primary);
if (real_primary == templess_primary){
ldout(cct, 10) << __func__ << " removing primary_temp "
<< pgid << " -> " << real_primary
void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
const OSDMap& oldmap,
- const OSDMap& tmpmap,
+ const OSDMap& nextmap,
Incremental *pending_inc)
{
ldout(cct, 10) << __func__ << dendl;
set<pg_t> to_cancel;
map<int, map<int, float>> rule_weight_map;
- for (auto& p : tmpmap.pg_upmap) {
+ for (auto& p : nextmap.pg_upmap) {
to_check.insert(p.first);
}
- for (auto& p : tmpmap.pg_upmap_items) {
+ for (auto& p : nextmap.pg_upmap_items) {
to_check.insert(p.first);
}
for (auto& p : pending_inc->new_pg_upmap) {
to_check.insert(p.first);
}
for (auto& pg : to_check) {
- auto crush_rule = tmpmap.get_pg_pool_crush_rule(pg);
+ auto crush_rule = nextmap.get_pg_pool_crush_rule(pg);
if (crush_rule < 0) {
lderr(cct) << __func__ << " unable to load crush-rule of pg "
<< pg << dendl;
map<int, float> weight_map;
auto it = rule_weight_map.find(crush_rule);
if (it == rule_weight_map.end()) {
- auto r = tmpmap.crush->get_rule_weight_osd_map(crush_rule, &weight_map);
+ auto r = nextmap.crush->get_rule_weight_osd_map(crush_rule, &weight_map);
if (r < 0) {
lderr(cct) << __func__ << " unable to get crush weight_map for "
<< "crush_rule " << crush_rule << dendl;
} else {
weight_map = it->second;
}
- auto type = tmpmap.crush->get_rule_failure_domain(crush_rule);
+ auto type = nextmap.crush->get_rule_failure_domain(crush_rule);
if (type < 0) {
lderr(cct) << __func__ << " unable to load failure-domain-type of pg "
<< pg << dendl;
<< dendl;
vector<int> raw;
int primary;
- tmpmap.pg_to_raw_up(pg, &raw, &primary);
+ nextmap.pg_to_raw_up(pg, &raw, &primary);
set<int> parents;
for (auto osd : raw) {
if (type > 0) {
- auto parent = tmpmap.crush->get_parent_of_type(osd, type, crush_rule);
+ auto parent = nextmap.crush->get_parent_of_type(osd, type, crush_rule);
if (parent < 0) {
auto r = parents.insert(parent);
if (!r.second) {
to_cancel.insert(pg);
break;
}
- auto adjusted_weight = tmpmap.get_weightf(it->first) * it->second;
+ auto adjusted_weight = nextmap.get_weightf(it->first) * it->second;
if (adjusted_weight == 0) {
// osd is out/crush-out
to_cancel.insert(pg);