From: Greg Farnum Date: Sat, 18 Jan 2014 01:23:33 +0000 (-0800) Subject: OSDMap: Populate primary_temp values a little more carefully X-Git-Tag: v0.78~297^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1111%2Fhead;p=ceph.git OSDMap: Populate primary_temp values a little more carefully In _get_temp_osds(), we populate temp_pg from the list in the OSDMap, but we also skip anybody in the list who's down. We need to account for those skips when setting the primary. It's easy enough to do -- just look at the output pg_temp list instead of the OSDMap's starting one. Fixes: #7177 Signed-off-by: Greg Farnum --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 3f7e12945bd..5c5368a486c 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -1376,8 +1376,8 @@ void OSDMap::_get_temp_osds(const pg_pool_t& pool, pg_t pg, *temp_primary = -1; if (pp != primary_temp->end()) *temp_primary = pp->second; - else if (p != pg_temp->end()) // apply pg_temp's primary - *temp_primary = p->second.front(); + else if (!temp_pg->empty()) // apply pg_temp's primary + *temp_primary = temp_pg->front(); } int OSDMap::pg_to_osds(pg_t pg, vector *raw, int *primary) const