From: Samuel Just Date: Wed, 26 Feb 2014 00:47:21 +0000 (-0800) Subject: OSDMap::_pg_to_up_acting_osds: use _acting_primary unless acting is empty X-Git-Tag: v0.78~117^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1317%2Fhead;p=ceph.git OSDMap::_pg_to_up_acting_osds: use _acting_primary unless acting is empty If the temp set for whatever reason has only CRUSH_ITEM_NONE, we need primary to be -1. Signed-off-by: Samuel Just --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 253e10d48a5..7fe4d5248de 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -1555,10 +1555,10 @@ void OSDMap::_pg_to_up_acting_osds(pg_t pg, vector *up, int *up_primary, _raw_to_up_osds(*pool, raw, &_up, &_up_primary); _apply_primary_affinity(pps, *pool, &_up, &_up_primary); _get_temp_osds(*pool, pg, &_acting, &_acting_primary); - if (_acting.empty()) + if (_acting.empty()) { _acting = _up; - if (_acting_primary == -1) _acting_primary = _up_primary; + } if (up) up->swap(_up); if (up_primary)