From: Mohamad Gebai Date: Mon, 18 Feb 2019 18:45:02 +0000 (-0500) Subject: mon: show no[deep-]scrub flags per pool in the status X-Git-Tag: v15.1.0~2739^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c8154afa7ab28972c3787b4106c931d013a0298e;p=ceph.git mon: show no[deep-]scrub flags per pool in the status Fixes: http://tracker.ceph.com/issues/38029 Signed-off-by: Mohamad Gebai --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 95855ad1105f..a93d45d27bb2 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -5157,6 +5157,31 @@ void OSDMap::check_health(health_check_map_t *checks) const } } + std::list 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