diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index ed960ba916359..53faeafece945 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -1642,16 +1642,16 @@ void OSDMap::dedup(const OSDMap *o, OSDMap *n) 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(); @@ -1660,7 +1660,7 @@ void OSDMap::clean_temps(CephContext *cct, // 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; } @@ -1674,7 +1674,7 @@ void OSDMap::clean_temps(CephContext *cct, // redundant pg_temp? vector 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 << " " @@ -1682,7 +1682,7 @@ void OSDMap::clean_temps(CephContext *cct, 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; @@ -1695,9 +1695,9 @@ void OSDMap::clean_temps(CephContext *cct, } } - 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; @@ -1707,8 +1707,8 @@ void OSDMap::clean_temps(CephContext *cct, vector 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 @@ -1723,7 +1723,7 @@ void OSDMap::clean_temps(CephContext *cct, 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; @@ -1731,10 +1731,10 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct, set to_cancel; map> 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) { @@ -1744,7 +1744,7 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct, 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; @@ -1753,7 +1753,7 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct, map 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; @@ -1763,7 +1763,7 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct, } 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; @@ -1776,11 +1776,11 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct, << dendl; vector raw; int primary; - tmpmap.pg_to_raw_up(pg, &raw, &primary); + nextmap.pg_to_raw_up(pg, &raw, &primary); set 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) { @@ -1803,7 +1803,7 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct, 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);