}
vector<int> raw, up;
pg_to_raw_upmap(pg, &raw, &up);
- auto i = pg_upmap.find(pg);
- if (i != pg_upmap.end() && raw == i->second) {
- ldout(cct, 10) << " removing redundant pg_upmap "
- << i->first << " " << i->second
- << dendl;
- to_cancel->push_back(pg);
- continue;
- }
- auto j = pg_upmap_items.find(pg);
- if (j != pg_upmap_items.end()) {
- mempool::osdmap::vector<pair<int,int>> newmap;
- for (auto& p : j->second) {
- if (std::find(raw.begin(), raw.end(), p.first) == raw.end()) {
- // cancel mapping if source osd does not exist anymore
- continue;
- }
- if (p.second != CRUSH_ITEM_NONE && p.second < max_osd &&
- p.second >= 0 && osd_weight[p.second] == 0) {
- // cancel mapping if target osd is out
- continue;
- }
- newmap.push_back(p);
- }
- if (newmap.empty()) {
- ldout(cct, 10) << " removing no-op pg_upmap_items "
- << j->first << " " << j->second
- << dendl;
- to_cancel->push_back(pg);
- continue;
- } else if (newmap != j->second) {
- ldout(cct, 10) << " simplifying partially no-op pg_upmap_items "
- << j->first << " " << j->second
- << " -> " << newmap
- << dendl;
- to_remap->insert({pg, newmap});
- any_change = true;
- continue;
- }
- }
auto crush_rule = get_pg_pool_crush_rule(pg);
auto r = crush->verify_upmap(cct,
crush_rule,
break;
}
}
+ if (!to_cancel->empty() && to_cancel->back() == pg)
+ continue;
+ // okay, upmap is valid
+ // continue to check if it is still necessary
+ auto i = pg_upmap.find(pg);
+ if (i != pg_upmap.end() && raw == i->second) {
+ ldout(cct, 10) << " removing redundant pg_upmap "
+ << i->first << " " << i->second
+ << dendl;
+ to_cancel->push_back(pg);
+ continue;
+ }
+ auto j = pg_upmap_items.find(pg);
+ if (j != pg_upmap_items.end()) {
+ mempool::osdmap::vector<pair<int,int>> newmap;
+ for (auto& p : j->second) {
+ if (std::find(raw.begin(), raw.end(), p.first) == raw.end()) {
+ // cancel mapping if source osd does not exist anymore
+ continue;
+ }
+ if (p.second != CRUSH_ITEM_NONE && p.second < max_osd &&
+ p.second >= 0 && osd_weight[p.second] == 0) {
+ // cancel mapping if target osd is out
+ continue;
+ }
+ newmap.push_back(p);
+ }
+ if (newmap.empty()) {
+ ldout(cct, 10) << " removing no-op pg_upmap_items "
+ << j->first << " " << j->second
+ << dendl;
+ to_cancel->push_back(pg);
+ } else if (newmap != j->second) {
+ ldout(cct, 10) << " simplifying partially no-op pg_upmap_items "
+ << j->first << " " << j->second
+ << " -> " << newmap
+ << dendl;
+ to_remap->insert({pg, newmap});
+ any_change = true;
+ }
+ }
}
any_change = any_change || !to_cancel->empty();
return any_change;
f->dump_int("num_osds", get_num_osds());
f->dump_int("num_up_osds", get_num_up_osds());
f->dump_int("num_in_osds", get_num_in_osds());
- f->dump_bool("full", test_flag(CEPH_OSDMAP_FULL) ? true : false);
- f->dump_bool("nearfull", test_flag(CEPH_OSDMAP_NEARFULL) ? true : false);
f->dump_unsigned("num_remapped_pgs", get_num_pg_temp());
f->close_section();
} else {
<< get_num_osds() << " total, "
<< get_num_up_osds() << " up, "
<< get_num_in_osds() << " in";
- if (test_flag(CEPH_OSDMAP_FULL))
- out << "; full flag set";
- else if (test_flag(CEPH_OSDMAP_NEARFULL))
- out << "; nearfull flag set";
}
bool OSDMap::crush_rule_in_use(int rule_id) const
}
}
+ std::list<std::string> scrub_messages;
+ bool noscrub = false, nodeepscrub = false;
+ for (const auto &p : pools) {
+ if (p.second.flags & pg_pool_t::FLAG_NOSCRUB) {
+ ostringstream ss;
+ ss << "Pool " << get_pool_name(p.first) << " has noscrub flag";
+ scrub_messages.push_back(ss.str());
+ noscrub = true;
+ }
+ if (p.second.flags & pg_pool_t::FLAG_NODEEP_SCRUB) {
+ ostringstream ss;
+ ss << "Pool " << get_pool_name(p.first) << " has nodeep-scrub flag";
+ scrub_messages.push_back(ss.str());
+ nodeepscrub = true;
+ }
+ }
+ if (noscrub || nodeepscrub) {
+ string out = "";
+ out += noscrub ? string("noscrub") + (nodeepscrub ? ", " : "") : "";
+ out += nodeepscrub ? "nodeep-scrub" : "";
+ auto& d = checks->add("POOL_SCRUB_FLAGS", HEALTH_OK,
+ "Some pool(s) have the " + out + " flag(s) set");
+ d.detail.splice(d.detail.end(), scrub_messages);
+ }
+
// OSD_OUT_OF_ORDER_FULL
{
// An osd could configure failsafe ratio, to something different