]> git-server-git.apps.pok.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)
committerNathan Cutler <ncutler@suse.com>
Wed, 26 Jun 2019 15:23:00 +0000 (17:23 +0200)
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)

src/osd/OSDMap.cc

index 0fdf0bc464a92751aa466053931dfe99eff928f2..2a8995948eb086464042ac68f0359becacf263f7 100644 (file)
@@ -1812,17 +1812,8 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
       to_cancel.insert(pg);
       continue;
     }
-    vector<int> raw_up;
-    int primary;
-    nextmap.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);
-    }
+    nextmap.pg_to_raw_upmap(pg, &up);
     auto crush_rule = nextmap.get_pg_pool_crush_rule(pg);
     auto r = nextmap.crush->verify_upmap(cct,
                                          crush_rule,