From a735244fe0db5209078e4953f91f0466c338244e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 26 May 2017 13:01:35 -0400 Subject: [PATCH] osd/OSDMap: some better pg-upmap debug output Signed-off-by: Sage Weil --- src/osd/OSDMap.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; } -- 2.47.3