From eeeec9772b094b326f14bba1fdeb2f8415040ef4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 10 May 2016 10:11:41 -0400 Subject: [PATCH] osd/OSDMap: move old pool check to remove_down_temps Better to do this on the projected map state. Signed-off-by: Sage Weil --- src/osd/OSDMap.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index b64d4d79963cf..5a481e20c57b1 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -1183,16 +1183,7 @@ void OSDMap::remove_redundant_temporaries(CephContext *cct, const OSDMap& osdmap for (map >::iterator p = osdmap.pg_temp->begin(); p != osdmap.pg_temp->end(); ++p) { - - // 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 (!osdmap.have_pg_pool(p->first.pool())) { - ldout(cct, 10) << " removing pg_temp " << p->first - << " for inexistent pool " << p->first.pool() << dendl; - pending_inc->new_pg_temp[p->first].clear(); - - } else if (pending_inc->new_pg_temp.count(p->first) == 0) { + if (pending_inc->new_pg_temp.count(p->first) == 0) { vector raw_up; int primary; osdmap.pg_to_raw_up(p->first, &raw_up, &primary); @@ -1227,7 +1218,7 @@ void OSDMap::remove_redundant_temporaries(CephContext *cct, const OSDMap& osdmap void OSDMap::remove_down_temps(CephContext *cct, const OSDMap& osdmap, Incremental *pending_inc) { - ldout(cct, 10) << "remove_down_pg_temp" << dendl; + ldout(cct, 10) << __func__ << dendl; OSDMap tmpmap; tmpmap.deepish_copy_from(osdmap); tmpmap.apply_incremental(*pending_inc); @@ -1235,6 +1226,15 @@ void OSDMap::remove_down_temps(CephContext *cct, for (map >::iterator p = tmpmap.pg_temp->begin(); p != tmpmap.pg_temp->end(); ++p) { + // 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 (!osdmap.have_pg_pool(p->first.pool())) { + ldout(cct, 10) << __func__ << " removing pg_temp " << p->first + << " for nonexistent pool " << p->first.pool() << dendl; + pending_inc->new_pg_temp[p->first].clear(); + continue; + } // all osds down? unsigned num_up = 0; for (auto o : p->second) { -- 2.39.5