]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMap: reweight::by_utilization - skip DNE osds 17064/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 17 Aug 2017 11:15:15 +0000 (19:15 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 18 Aug 2017 05:27:06 +0000 (13:27 +0800)
EC could set one or more members of acting set to CRUSH_ITEM_NONE,
which as a result can cause pgs_by_osd.resize() attempt to apply
for a large amount of memory which we can not afford.

Fix the above problem by always excluding a current DNE osd from
acting set.

Fixes: http://tracker.ceph.com/issues/20970
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/mon/PGMap.cc

index 9ec7d8f8a834ada0d49401d695b4a2bfd1117e40..244f21f04b641d98918b281deb2f019f6bc340d3 100644 (file)
@@ -4567,6 +4567,9 @@ int reweight::by_utilization(
       if (pools && pools->count(pg.first.pool()) == 0)
        continue;
       for (const auto acting : pg.second.acting) {
+        if (!osdmap.exists(acting)) {
+          continue;
+        }
        if (acting >= (int)pgs_by_osd.size())
          pgs_by_osd.resize(acting);
        if (pgs_by_osd[acting] == 0) {