]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: some better pg-upmap debug output 15319/head
authorSage Weil <sage@redhat.com>
Fri, 26 May 2017 17:01:35 +0000 (13:01 -0400)
committerSage Weil <sage@redhat.com>
Fri, 26 May 2017 18:01:10 +0000 (14:01 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSDMap.cc

index cbeb791ff668d5ef6ecf2f029717b507e7ab04f0..3ad283414f7c2ff9a39e4424843258b1892b74d4 100644 (file)
@@ -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<int,set<pg_t>> 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<int,float> osd_deviation;       // osd, deviation(pgs)
     multimap<float,int> deviation_osd;  // deviation(pgs), osd
     set<int> 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<int> 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;
 }