]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: add log for better debugging 27963/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>
Sun, 5 May 2019 09:37:48 +0000 (17:37 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit a89281ffbb50a4dfc700398e864138b5faaf00f5)

src/osd/OSDMap.cc

index 612ca3d0e5a1f6c35b3cad9a56801ce4d5449ee5..66172314c19373c7048997381f33aedb7f403d15 100644 (file)
@@ -4171,15 +4171,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();
 
@@ -4188,7 +4189,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) {