From: Sage Weil Date: Fri, 26 May 2017 17:01:35 +0000 (-0400) Subject: osd/OSDMap: some better pg-upmap debug output X-Git-Tag: v12.1.0~57^2~16^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F15319%2Fhead;p=ceph.git osd/OSDMap: some better pg-upmap debug output Signed-off-by: Sage Weil --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index cbeb791ff668..3ad283414f7c 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -3512,6 +3512,8 @@ int OSDMap::calc_pg_upmaps( } OSDMap tmp; tmp.deepish_copy_from(*this); + float start_deviation = 0; + float end_deviation = 0; int num_changed = 0; while (true) { map> pgs_by_osd; @@ -3559,6 +3561,7 @@ int OSDMap::calc_pg_upmaps( ldout(cct, 10) << " pgs_per_weight " << pgs_per_weight << dendl; // osd deviation + float total_deviation = 0; map osd_deviation; // osd, deviation(pgs) multimap deviation_osd; // deviation(pgs), osd set overfull; @@ -3574,7 +3577,12 @@ int OSDMap::calc_pg_upmaps( deviation_osd.insert(make_pair(deviation, i.first)); if (deviation >= 1.0) overfull.insert(i.first); + total_deviation += abs(deviation); } + if (num_changed == 0) { + start_deviation = total_deviation; + } + end_deviation = total_deviation; // build underfull, sorted from least-full to most-average vector underfull; @@ -3585,7 +3593,8 @@ int OSDMap::calc_pg_upmaps( break; underfull.push_back(i->second); } - ldout(cct, 10) << " overfull " << overfull + ldout(cct, 10) << " total_deviation " << total_deviation + << " overfull " << overfull << " underfull " << underfull << dendl; if (overfull.empty() || underfull.empty()) break; @@ -3673,5 +3682,7 @@ int OSDMap::calc_pg_upmaps( break; } } + ldout(cct, 10) << " start deviation " << start_deviation << dendl; + ldout(cct, 10) << " end deviation " << end_deviation << dendl; return num_changed; }