]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: add log for better debugging 27225/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 25 Mar 2019 10:24:16 +0000 (18:24 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 28 Mar 2019 02:10:44 +0000 (10:10 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit a89281ffbb50a4dfc700398e864138b5faaf00f5)

src/osd/OSDMap.cc

index 41ec432c63d57ae7c6aafc9e0aad3a65f4b71e5c..0c10811a88f58d2aaf58c16990a4988d872fce50 100644 (file)
@@ -4354,15 +4354,16 @@ int OSDMap::calc_pg_upmaps(
   map<int,float> osd_weight;
   for (auto& i : pools) {
     if (!only_pools.empty() && !only_pools.count(i.first))
-       continue;
+      continue;
     for (unsigned ps = 0; ps < i.second.get_pg_num(); ++ps) {
-       pg_t pg(ps, i.first);
-       vector<int> up;
-       tmp.pg_to_up_acting_osds(pg, &up, nullptr, nullptr, nullptr);
-       for (auto osd : up) {
-         if (osd != CRUSH_ITEM_NONE)
-           pgs_by_osd[osd].insert(pg);
-       }
+      pg_t pg(ps, i.first);
+      vector<int> up;
+      tmp.pg_to_up_acting_osds(pg, &up, nullptr, nullptr, nullptr);
+      ldout(cct, 20) << __func__ << " " << pg << " up " << up << dendl;
+      for (auto osd : up) {
+        if (osd != CRUSH_ITEM_NONE)
+         pgs_by_osd[osd].insert(pg);
+      }
     }
     total_pgs += i.second.get_size() * i.second.get_pg_num();
 
@@ -4371,7 +4372,10 @@ int OSDMap::calc_pg_upmaps(
                                      i.second.get_type(),
                                      i.second.get_size());
     tmp.crush->get_rule_weight_osd_map(ruleno, &pmap);
-    ldout(cct,30) << __func__ << " pool " << i.first << " ruleno " << ruleno << dendl;
+    ldout(cct,20) << __func__ << " pool " << i.first
+                  << " ruleno " << ruleno
+                  << " weight-map " << pmap
+                  << dendl;
     for (auto p : pmap) {
       auto adjusted_weight = tmp.get_weightf(p.first) * p.second;
       if (adjusted_weight == 0) {