From: Sage Weil Date: Wed, 11 May 2016 17:27:47 +0000 (-0400) Subject: osd/OSDMap: move redundant pg_temp check to remove_down_temps X-Git-Tag: v11.0.0~546^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bf9a9e241a3fd9963787be032af3cbf5b6b98016;p=ceph.git osd/OSDMap: move redundant pg_temp check to remove_down_temps Better to do this on the future map value. Signed-off-by: Sage Weil --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 5a481e20c57b..4bb9a13398d3 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -1179,20 +1179,6 @@ void OSDMap::remove_redundant_temporaries(CephContext *cct, const OSDMap& osdmap OSDMap::Incremental *pending_inc) { ldout(cct, 10) << "remove_redundant_temporaries" << dendl; - - for (map >::iterator p = osdmap.pg_temp->begin(); - p != osdmap.pg_temp->end(); - ++p) { - 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); - if (raw_up == p->second) { - ldout(cct, 10) << " removing unnecessary pg_temp " << p->first << " -> " << p->second << dendl; - pending_inc->new_pg_temp[p->first].clear(); - } - } - } if (!osdmap.primary_temp->empty()) { OSDMap templess; templess.deepish_copy_from(osdmap); @@ -1249,6 +1235,18 @@ void OSDMap::remove_down_temps(CephContext *cct, pending_inc->new_pg_temp[p->first].clear(); continue; } + // redundant pg_temp? + if (pending_inc->new_pg_temp.count(p->first) == 0) { + vector raw_up; + int primary; + tmpmap.pg_to_raw_up(p->first, &raw_up, &primary); + if (raw_up == p->second) { + ldout(cct, 10) << __func__ << " removing pg_temp " << p->first << " " + << p->second << " that matches raw_up mapping" << dendl; + pending_inc->new_pg_temp[p->first].clear(); + continue; + } + } } for (map::iterator p = tmpmap.primary_temp->begin(); p != tmpmap.primary_temp->end();