From 6ae96d33a84404a144e06c423796e4a3886d8e61 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Thu, 17 Aug 2017 19:15:15 +0800 Subject: [PATCH] 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 --- src/mon/PGMap.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 9ec7d8f8a834a..244f21f04b641 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) { -- 2.39.5