]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: respect temp primary without temp acting 1319/head
authorSamuel Just <sam.just@inktank.com>
Wed, 26 Feb 2014 06:48:18 +0000 (22:48 -0800)
committerSamuel Just <sam.just@inktank.com>
Wed, 26 Feb 2014 07:09:57 +0000 (23:09 -0800)
be2748c6d540891f2e1a62e7034cb44f7d04bf18 ensured that
if the temp acting mapping contains only CRUSH_ITEM_NONE,
that the acting_primary is left at -1.  However, even if
acting.empty(), we need to respect a temp_primary mapping.
Thus, use _acting_primary unless acting.empty() &&
acting_primary == -1.

Bug introduced in be2748c6d540891f2e1a62e7034cb44f7d04bf18.
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/OSDMap.cc

index 7fe4d5248de96d77873e78f748b89d83d91d9143..57b70825d7e814efed8433ea85614029452d02ac 100644 (file)
@@ -1557,7 +1557,9 @@ void OSDMap::_pg_to_up_acting_osds(pg_t pg, vector<int> *up, int *up_primary,
   _get_temp_osds(*pool, pg, &_acting, &_acting_primary);
   if (_acting.empty()) {
     _acting = _up;
-    _acting_primary = _up_primary;
+    if (_acting_primary == -1) {
+      _acting_primary = _up_primary;
+    }
   }
   if (up)
     up->swap(_up);