From: xie xingguo Date: Thu, 17 Aug 2017 11:15:15 +0000 (+0800) Subject: mon/PGMap: reweight::by_utilization - skip DNE osds X-Git-Tag: v13.0.0~70^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6ae96d33a84404a144e06c423796e4a3886d8e61;p=ceph-ci.git mon/PGMap: reweight::by_utilization - skip DNE osds 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 --- diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 9ec7d8f8a83..244f21f04b6 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -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) {