]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: maybe_remove_pg_upmaps - s/pg_to_raw_up/pg_to_raw_upmap/
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 1 Jun 2019 04:13:19 +0000 (12:13 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 18 Jun 2019 02:08:49 +0000 (10:08 +0800)
The upmap results are directly applied after calling
_pg_to_raw_osds, which means it basically has nothing to do
with the up/down status.
In other words, if a pg_upmap/pg_upmap_items remapped a pg
into some down osds and is now causing collided result,
we should still be able to detect and cancel that.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit d9ed406a61c46858dd8350af5c72d7b8824dcdd3)

Conflicts:
s/nextmap/tmpmap/

src/osd/OSDMap.cc

index 66172314c19373c7048997381f33aedb7f403d15..1daa7eaba1694746fff56e2c576184370c9b5f14 100644 (file)
@@ -1668,17 +1668,8 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
       to_cancel.insert(pg);
       continue;
     }
-    vector<int> raw_up;
-    int primary;
-    tmpmap.pg_to_raw_up(pg, &raw_up, &primary);
     vector<int> up;
-    up.reserve(raw_up.size());
-    for (auto osd : raw_up) {
-      // skip non-existent/down osd for erasure-coded PGs
-      if (osd == CRUSH_ITEM_NONE)
-        continue;
-      up.push_back(osd);
-    }
+    tmpmap.pg_to_raw_upmap(pg, &up);
     auto crush_rule = tmpmap.get_pg_pool_crush_rule(pg);
     auto r = tmpmap.crush->verify_upmap(cct,
                                         crush_rule,