Skip to content

Commit

Permalink
osd/OSDMap: add log for better debugging
Browse files Browse the repository at this point in the history
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit a89281f)
  • Loading branch information
xiexingguo committed Mar 28, 2019
1 parent 3d2945d commit 16b7cc1
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/osd/OSDMap.cc
Expand Up @@ -4019,15 +4019,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();

Expand All @@ -4036,7 +4037,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) {
Expand Down

0 comments on commit 16b7cc1

Please sign in to comment.